In mathematics, a square triangular number (or triangular square number) is a number which is both a triangular number and a perfect square. There are infinitely many square triangular numbers; the first few are:
Write Nk for the kth square triangular number, and write sk and tk for the sides of the corresponding square and triangle, so that
Define the triangular root of a triangular number N = n(n + 1)/2 to be n. From this definition and the quadratic formula,
Therefore, N is triangular (n is an integer) if and only if 8N + 1 is square. Consequently, a square number M2 is also triangular if and only if 8M2 + 1 is square, that is, there are numbers x and y such that x2 − 8y2 = 1. This is an instance of the Pell equation with n = 8. All Pell equations have the trivial solution x = 1, y = 0 for any n; this is called the zeroth solution, and indexed as (x0, y0) = (1,0). If (xk, yk) denotes the kth nontrivial solution to any Pell equation for a particular n, it can be shown by the method of descent that
Hence there are an infinity of solutions to any Pell equation for which there is one non-trivial one, which holds whenever n is not a square. The first non-trivial solution when n = 8 is easy to find: it is (3,1). A solution (xk, yk) to the Pell equation for n = 8 yields a square triangular number and its square and triangular roots as follows:
Hence, the first square triangular number, derived from (3,1), is 1, and the next, derived from 6 × (3,1) − (1,0) = (17,6), is 36.
The sequences Nk, sk and tk are the OEIS sequences OEIS: A001110, OEIS: A001109, and OEIS: A001108 respectively.
In 1778 Leonhard Euler determined the explicit formula: 12–13
Other equivalent formulas (obtained by expanding this formula) that may be convenient include
The corresponding explicit formulas for sk and tk are:: 13
The problem of finding square triangular numbers reduces to Pell's equation in the following way.
Every triangular number is of the form t(t + 1)/2. Therefore we seek integers t, s such that
Rearranging, this becomes
and then letting x = 2t + 1 and y = 2s, we get the Diophantine equation
which is an instance of Pell's equation. This particular equation is solved by the Pell numbers Pk as
and therefore all solutions are given by
There are many identities about the Pell numbers, and these translate into identities about the square triangular numbers.
There are recurrence relations for the square triangular numbers, as well as for the sides of the square and triangle involved. We have: (12)
We have: 13
All square triangular numbers have the form b2c2, where b/c is a convergent to the continued fraction expansion of √.
A. V. Sylwester gave a short proof that there are an infinity of square triangular numbers: If the nth triangular number n(n + 1)/2 is square, then so is the larger 4n(n + 1)th triangular number, since:
As the product of three squares, the right hand side is square. The triangular roots tk are alternately simultaneously one less than a square and twice a square if k is even, and simultaneously a square and one less than twice a square if k is odd. Thus,
In each case, the two square roots involved multiply to give sk: 5 × 7 = 35, 12 × 17 = 204, and 29 × 41 = 1189.
36 − 1 = 35, 1225 − 36 = 1189, and 41616 − 1225 = 40391. In other words, the difference between two consecutive square triangular numbers is the square root of another square triangular number.
The generating function for the square triangular numbers is:
As k becomes larger, the ratio tk/sk approaches √ ≈ 1.41421356, and the ratio of successive square triangular numbers approaches (1 + √)4 = 17 + 12√ ≈ 33.970562748. The table below shows values of k between 0 and 11, which comprehend all square triangular numbers up to 1016.
|k||Nk||sk||tk||tk/sk||Nk/Nk − 1|
According to the records, it was presented to the St. Petersburg Academy on May 4, 1778.