A triangular square number (or square triangular number) is a number which is both a triangular number and a perfect square. There is an infinity of triangular squares, given by the formula

The problem of finding triangular square numbers reduces to Pell's equation in the following way. Every triangular number is of the form n(n − 1)/2. Therefore we seek integers n, m such that

With a bit of algebra this becomes

and then letting k = 2n + 1 and h = 2m, we get the Diophantine equation

which is an instance of Pell's equation.
The kth triangular square Nk is equal to the sth perfect square and the tth triangular number, such that


t is given by the formula
.
As k becomes larger, the ratio t/s approaches the square root of two:
External references