Maths WorkshopMaths problems with full solutions
Exercise 1340Number theory › Diophantine equationsOlympiadAdded 5 Nov 2026

Infinitely many triangular numbers that are squares

#Pell equation#recurrence#infinitely many

Statement

Show that there are infinitely many positive integers nn for which Tn=n(n+1)2T_n=\dfrac{n(n+1)}2 is a perfect square.

Hint

Complete the square: n(n+1)=2m2n(n+1)=2m^2 is equivalent to (2n+1)2−8m2=1(2n+1)^2-8m^2=1. Find a way to produce a new solution of x2−8y2=1x^2-8y^2=1 from an old one.

Show solutionHide solution

Solution

Reduction. n(n+1)2=m2  ⟺  4n2+4n=8m2  ⟺  (2n+1)2−8m2=1\frac{n(n+1)}2=m^2\iff 4n^2+4n=8m^2\iff(2n+1)^2-8m^2=1. So it suffices to find infinitely many solutions (x,y)(x,y) of x2−8y2=1x^2-8y^2=1 in positive integers with xx odd: then n=x−12n=\frac{x-1}2 and m=ym=y.

Generating solutions. Suppose x2−8y2=1x^2-8y^2=1. Put x′=3x+8yx'=3x+8y, y′=x+3yy'=x+3y. Then
x′2−8y′2=9x2+48xy+64y2−8x2−48xy−72y2=x2−8y2=1.x'^2-8y'^2=9x^2+48xy+64y^2-8x^2-48xy-72y^2=x^2-8y^2=1.
Also x′≡x(mod2)x'\equiv x\pmod 2 (since 8y8y is even), so x′x' is odd if xx is, and x′>xx'>x, y′>yy'>y.

Start. (x,y)=(3,1)(x,y)=(3,1) satisfies 9−8=19-8=1 and xx is odd. The recurrence gives (3,1)→(17,6)→(99,35)→(577,204)→⋯(3,1)\to(17,6)\to(99,35)\to(577,204)\to\cdots, an infinite strictly increasing sequence of solutions with xx odd.

Result. The corresponding n=x−12n=\frac{x-1}2 are 1,8,49,288,…1,8,49,288,\dots, with T1=12T_1=1^2, T8=36=62T_8=36=6^2, T49=1225=352T_{49}=1225=35^2, T288=41616=2042T_{288}=41616=204^2.

Remark. Pell's theory shows these are *all* the solutions (they come from powers of 3+223+2\sqrt2).

Lesson. A Pell-type equation has an infinite family generated by multiplying by a unit such as 3+83+\sqrt8; reduce a problem to x2−Dy2=1x^2-Dy^2=1 by completing the square.