Square triangular number

In mathematics, a square triangular number (or triangular square number) is a number which is both a triangular number and a square number.

There are infinitely many square triangular numbers; the first few are: Write

th square triangular number, and write

for the sides of the corresponding square and triangle, so that Define the triangular root of a triangular number

From this definition and the quadratic formula, Therefore,

is an integer) if and only if

Consequently, a square number

is square, that is, there are numbers

This is an instance of the Pell equation

All Pell equations have the trivial solution

; this is called the zeroth solution, and indexed as

th nontrivial solution to any Pell equation for a particular

, it can be shown by the method of descent that the next solution is Hence there are infinitely many solutions to any Pell equation for which there is one non-trivial one, which is true whenever

The first non-trivial solution when

is easy to find: it is

to the Pell equation for

yields a square triangular number and its square and triangular roots as follows: Hence, the first square triangular number, derived from

The sequences

are the OEIS sequences OEIS: A001110, OEIS: A001109, and OEIS: A001108 respectively.

In 1778 Leonhard Euler determined the explicit formula[1][2]: 12–13 Other equivalent formulas (obtained by expanding this formula) that may be convenient include The corresponding explicit formulas for

are:[2]: 13 The solution to the Pell equation can be expressed as a recurrence relation for the equation's solutions.

This can be translated into recurrence equations that directly express the square triangular numbers, as well as the sides of the square and triangle involved.

We have[3]: (12) We have[1][2]: 13 All square triangular numbers have the form

is a convergent to the continued fraction expansion of

, the square root of 2.

[4] A. V. Sylwester gave a short proof that there are infinitely many square triangular numbers: If the

th triangular number

is square, then so is the larger

th triangular number, since: The left hand side of this equation is in the form of a triangular number, and as the product of three squares, the right hand side is square.

[5] The generating function for the square triangular numbers is:[6]

Square triangular number 36 depicted as a triangular number and as a square number.