# Square triangular number

(Redirected from Triangular square number)
For squares of triangular numbers, see squared triangular number.
Square triangular number 36 depicted as a triangular number and as a square number.

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 an infinite number of square triangular numbers; the first few are 0, 1, 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056, 1882672131025 (sequence A001110 in OEIS).

## Explicit formulas

Write Nk for the kth square triangular number, and write sk and tk for the sides of the corresponding square and triangle, so that

$N_k = s_k^2 = \frac{t_k(t_k+1)}{2}.$

We define the triangular root of a triangular number $N = \frac{n(n+1)}{2}$ to be $n$. From this definition and the quadratic formula, we get $n = \frac{\sqrt{8N + 1} - 1}{2}.$ Therefore, $N$ is triangular if and only if $8N + 1$ is square, and naturally $N^2$ is square and triangular if and only if $8N^2 + 1$ is square, i. e., there are numbers $x$ and $y$ such that $x^2 - 8y^2 = 1$. This is an instance of the Pell equation, with n=8. All Pell equations have the trivial solution (1,0), for any n; this solution is called the zeroth, and indexed as $(x_0,y_0)$. If we let $(x_k,y_k)$ denote the k'th non-trivial solution to any Pell equation for a particular n, it can be shown by the method of descent that $x_{k+1} = 2x_k x_1 - x_{k-1}$ and $y_{k+1} = 2y_k x_1 - y_{k-1}$. 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 $(x_k,y_k)$ to the Pell equation for n=8 yields a square triangular number and its square and triangular roots as follows: $s_k = y_k , t_k = \frac{x_k - 1}{2},$ and $N_k = y_k^2.$ Hence, the first square triangular number, derived from (3,1), is 1 (how exciting!), and the next, derived from (17,6) (=6×(3,1)-(1,0)), is 36.

The sequences Nk, sk and tk are the OEIS sequences , , and respectively.

In 1778 Leonhard Euler determined the explicit formula[1][2]:12–13

$N_k = \left( \frac{(3 + 2\sqrt{2})^k - (3 - 2\sqrt{2})^k}{4\sqrt{2}} \right)^2.$

Other equivalent formulas (obtained by expanding this formula) that may be convenient include

\begin{align} N_k &= {1 \over 32} \left( ( 1 + \sqrt{2} )^{2k} - ( 1 - \sqrt{2} )^{2k} \right)^2 = {1 \over 32} \left( ( 1 + \sqrt{2} )^{4k}-2 + ( 1 - \sqrt{2} )^{4k} \right) \\ &= {1 \over 32} \left( ( 17 + 12\sqrt{2} )^k -2 + ( 17 - 12\sqrt{2} )^k \right). \end{align}

The corresponding explicit formulas for sk and tk are [2]:13

$s_k = \frac{(3 + 2\sqrt{2})^k - (3 - 2\sqrt{2})^k}{4\sqrt{2}}$

and

$t_k = \frac{(3 + 2\sqrt{2})^k + (3 - 2\sqrt{2})^k - 2}{4}.$

## Pell's equation

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

$\frac{t(t+1)}{2} = s^2.$

With a bit of algebra this becomes

$(2t+1)^2=8s^2+1,$

and then letting x = 2t + 1 and y = 2s, we get the Diophantine equation

$x^2 - 2y^2 =1$

which is an instance of Pell's equation. This particular equation is solved by the Pell numbers Pk as[4]

$x = P_{2k} + P_{2k-1}, \quad y = P_{2k};$

and therefore all solutions are given by

$s_k = \frac{P_{2k}}{2}, \quad t_k = \frac{P_{2k} + P_{2k-1} -1}{2}, \quad N_k = \left( \frac{P_{2k}}{2} \right)^2.$

There are many identities about the Pell numbers, and these translate into identities about the square triangular numbers.

## Recurrence relations

There are recurrence relations for the square triangular numbers, as well as for the sides of the square and triangle involved. We have[5]:(12)

$N_k = 34N_{k-1} - N_{k-2} + 2,\text{ with }N_0 = 0\text{ and }N_1 = 1.$
$N_k = \left(6\sqrt{N_{k-1}} - \sqrt{N_{k-2}}\right)^2,\text{ with }N_0 = 0\text{ and }N_1 = 1.$

We have[1][2]:13

$s_k = 6s_{k-1} - s_{k-2},\text{ with }s_0 = 0\text{ and }s_1 = 1;$
$t_k = 6t_{k-1} - t_{k-2} + 2,\text{ with }t_0 = 0\text{ and }t_1 = 1.$

## Other characterizations

All square triangular numbers have the form b2c2, where b / c is a convergent to the continued fraction for the square root of 2.[6]

A. V. Sylwester gave a short proof that there are an infinity of square triangular numbers, to wit:[7]

If the triangular number n(n+1)/2 is square, then so is the larger triangular number

$\frac{\bigl( 4n(n+1) \bigr) \bigl( 4n(n+1)+1 \bigr)}{2} = 2^2 \, \frac{n(n+1)}{2} \,(2n+1)^2.$

We know this result has to be a square, because it is a product of three squares: 2^2 (by the exponent), (n(n+1))/2 (the n'th triangular number, by proof assumption), and the (2n+1)^2 (by the exponent). The product of any numbers that are squares is naturally going to result in another square, which can best be proven by geometrically visualizing the multiplication as the multiplying of a NxN box by an MxM box, which is done by placing one MxM box inside each cell of the NxN box, naturally producing another square result.

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

$\frac{1+z}{(1-z)(z^2 - 34z + 1)} = 1 + 36z + 1225 z^2 + \cdots.$

## Relations with other numerical puzzles

The square triangular numbers are connected with several other mathematical puzzles, due to their relation with the Pell equation $x^2 - 2y^2 = 1$.

First, the quasi-isosceles Pythagorean triples. These are triples $(a,b,c)$ such that $a^2 + b^2 = c^2$ and also $b = a + 1$. The first few are (0,1,1), (3,4,5), and (20,21,29). They are connected to the square triangular numbers, or rather their square and triangular roots $s_k$ and $t_k$, by $a_k + c_k = t_k$ and $a_k + b_k + c_k = 2s_k$. We can derive (a, b, c) from (s, t) by $a_k = 2s_k - t_k - 1, b_k = 2s_k - t_k,$and $c_k = 2t_k - 2s_k + 1.$

Second is Dudeney's problem of the professor's house number. The professor lives on a long street with house numbers that start at one and go up to a number to be determined by the solver, not skipping any integers. The professor's house number is such that the sum of all the numbers less than his is exactly equal to the sum of all the numbers greater than his. For example, $1 + 2 + 3 + 4 + 5 = 7 + 8$. If the professor's house number is $s_k$ and the street has $t_k$ houses for the same k, then the problem is solved. A variation on this problem has the professor living on the odd-numbered side of the street, and has only the odd-numbered houses added up to create the two matching totals. Example: $1 + 3 + 5 + \cdots + 37 + 39 = 43 + 45 + 47 + 49 + 51 + 53 + 55 + 57$. This variation is solved by letting the professor live on house $b_k$ (numbered $2b_k - 1$) on the side of the street having a total of $c_k$ houses (the last numbered $2c_k - 1$), where $(a_k, b_k, c_k)$ is a quasi-isosceles Pythagorean triple, described above.

Third is Martin Gardner's problem of the Jones sisters: Mr. Jones has some daughters, and if you meet any two of them at random on the street, the probability that both have blue eyes is exactly one-half. How many daughters does Mr. Jones have, and how many of them have blue eyes? Mathematically, we are looking for two numbers $a$ and $b$ such that $\frac{a(a - 1)}{b(b - 1)} = 2$. One solution is $a = 21$ and $b = 15$, i. e., there are 21 daughters and 15 of them have blue eyes. This problem can also be stated in another form as the problem of Socrates and the hemlock: Socrates has just been convicted of slandering the gods, and instead of just executing him, the Greek tribunal decides to let the gods determine his fate. So they arrange some number of glasses in a circle, and put water in some of them and hemlock in the others. The number of glasses, and the number with hemlock, are such that when Socrates drinks the contents of two of them, he has exactly a 50-50 chance of survival. The only difference between this formulation of the problem and Gardner's one is that b is now the number of glasses with water, not hemlock. The solution to these problems is given by $a = y_k$ and $b = \frac{z_k + 1}{2}$, where $(x_k, y_k, z_k)$ is a quasi-isosceles Pythagorean triple.

## Numerical data

As $k$ becomes larger, the ratio $t_k/s_k$ approaches $\sqrt{2} \approx 1.41421$ and the ratio of successive square triangular numbers approaches $(1+\sqrt{2})^4 = 17+12\sqrt{2} \approx 33.97056$. The table below shows values of $k$ between 0 and 7.

$k$ $N_k$ $s_k$ $t_k$ $t_k/s_k$ $N_k/N_{k-1}$
$0$ $0$ $0$ $0$
$1$ $1$ $1$ $1$ $1$
$2$ $36$ $6$ $8$ $1.33333$ $36$
$3$ $1\,225$ $35$ $49$ $1.4$ $34.02778$
$4$ $41\,616$ $204$ $288$ $1.41176$ $33.97224$
$5$ $1\,413\,721$ $1\,189$ $1\,681$ $1.41379$ $33.97061$
$6$ $48\,024\,900$ $6\,930$ $9\,800$ $1.41414$ $33.97056$
$7$ $1\,631\,432\,881$ $40\,391$ $57\,121$ $1.41420$ $33.97056$

## Notes

1. ^ a b Dickson, Leonard Eugene (1999) [1920]. History of the Theory of Numbers 2. Providence: American Mathematical Society. p. 16. ISBN 978-0-8218-1935-7.
2. ^ a b c Euler, Leonhard (1813). "Regula facilis problemata Diophantea per numeros integros expedite resolvendi (An easy rule for Diophantine problems which are to be resolved quickly by integral numbers)". Memoires de l'academie des sciences de St.-Petersbourg (in Latin) 4: 3–17. Retrieved 2009-05-11. According to the records, it was presented to the St. Petersburg Academy on May 4, 1778.
3. ^ Barbeau, Edward (2003). Pell's Equation. Problem Books in Mathematics. New York: Springer. pp. 16–17. ISBN 978-0-387-95529-2. Retrieved 2009-05-10.
4. ^ Hardy, G. H.; Wright, E. M. (1979). An Introduction to the Theory of Numbers (5th ed.). Oxford University Press. p. 210. ISBN 0-19-853171-0. Theorem 244
5. ^
6. ^ Ball, W. W. Rouse; Coxeter, H. S. M. (1987). Mathematical Recreations and Essays. New York: Dover Publications. p. 59. ISBN 978-0-486-25357-2.
7. ^ Pietenpol, J. L.; A. V. Sylwester; Erwin Just; R. M Warten (February 1962). "Elementary Problems and Solutions: E 1473, Square Triangular Numbers". American Mathematical Monthly (Mathematical Association of America) 69 (2): 168–169. ISSN 0002-9890. JSTOR 2312558.
8. ^ Plouffe, Simon (August 1992). "1031 Generating Functions" (PDF). University of Quebec, Laboratoire de combinatoire et d'informatique mathématique. p. A.129. Retrieved 2009-05-11.