There exist triangular numbers that are also square
Wonder of wonders. I was very pleasantly surprised by a message from Chris Whitrow:
I just stumbled across your site and noticed your page on triangular and
square numbers. I couldn't help dropping this note to point out the curious fact that there is also an infinite set of numbers which are simultaneously both triangular and square. There is a recurrence relation for generating them:
S(n+1) = 4·S(n)·[8·S(n) + 1]
Starting with S(1) = 1, S(2) = 36, and so on. Proof is fairly
straightforward. Well, it seems curious that a thing can be both a
triangle and a square, doesn't it?
Yes, of course. How can something be square and triangular simultaneously?
(2) proves the converse as well: a square decreased by unity gives eight triangles.
This simple rule explains the recurrence relation (1). However, (1) does not enumerate all such numbers. From (1), we get S(3) = 41616, whereas there is another number, 1225, that is both triangular and square: 1225 = 49·50/2 = 352.
The question was in fact posted as the problem E1473 (AMM, 1962, p. 168) by J.L. Pietepol and solved by A.V. Sylvester [Mathematical Morsels, p. 145, Mathematical Quickies, #186]. Let Tn = n(n + 1)/2 denote the nth triangular number. The solution follows from the observation that if Tn is a perfect square, so is T4n(n+1). Indeed, let n(n + 1)/2 = k2. Then 4n(n + 1) = 8k2. Continue:
T4n(n+1) = T8k2
= 8k2(8k2 + 1)/2 = 4k2(8k2 + 1)
= 4k2[4n(n + 1) + 1] = 4k2[4n2 + 4n + 1]
= 4k2(2n + 1)2.
All such numbers can be found by solving a Pell equation: 8x2 + 1 = y2 which plays a prominent role in number theory.
Numbers Simultaneously Square and Triangular
8x2 + 1 =
Side of triangle
Side of square
All such numbers can be obtained by squaring the members of the sequence generated from the recurrence relation