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 square number, in other words, the sum of all integers from {\displaystyle 1} to {\displaystyle n} has a square root that is an integer. There are infinitely many square triangular numbers; the first few are:
0, 1, 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056, 1882672131025 (sequence A001110 in the OEIS)
Write {\displaystyle N_{k}} for the {\displaystyle k}th square triangular number, and write {\displaystyle s_{k}} and {\displaystyle t_{k}} for the sides of the corresponding square and triangle, so that
Define the triangular root of a triangular number {\displaystyle N={\tfrac {n(n+1)}{2}}} to be {\displaystyle n}. From this definition and the quadratic formula,
Therefore, {\displaystyle N} is triangular ({\displaystyle n} is an integer) if and only if{\displaystyle 8N+1} is square. Consequently, a square number {\displaystyle M^{2}} is also triangular if and only if {\displaystyle 8M^{2}+1} is square, that is, there are numbers {\displaystyle x} and {\displaystyle y} such that {\displaystyle x^{2}-8y^{2}=1}. This is an instance of the Pell equation{\displaystyle x^{2}-ny^{2}=1} with {\displaystyle n=8}. All Pell equations have the trivial solution {\displaystyle x=1,y=0} for any {\displaystyle n}; this is called the zeroth solution, and indexed as {\displaystyle (x_{0},y_{0})=(1,0)}. If {\displaystyle (x_{k},y_{k})} denotes the {\displaystyle k}th nontrivial solution to any Pell equation for a particular {\displaystyle n}, 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 {\displaystyle n} is not a square. The first non-trivial solution when {\displaystyle n=8} is easy to find: it is {\displaystyle (3,1)}. A solution {\displaystyle (x_{k},y_{k})} to the Pell equation for {\displaystyle n=8} yields a square triangular number and its square and triangular roots as follows:
Hence, the first square triangular number, derived from {\displaystyle (3,1)}, is {\displaystyle 1}, and the next, derived from {\displaystyle 6\cdot (3,1)-(1,0)=(17,6)}, is {\displaystyle 36}.
The sequences {\displaystyle N_{k}}, {\displaystyle s_{k}} and {\displaystyle t_{k}} are the OEIS sequences OEIS: A001110, OEIS: A001109, and OEIS: A001108 respectively.
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)
{\displaystyle \displaystyle {\begin{aligned}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.\end{aligned}}}
{\displaystyle \displaystyle {\begin{aligned}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.\end{aligned}}}
A. V. Sylwester gave a short proof that there are infinitely many square triangular numbers: If the {\displaystyle n}th triangular number {\displaystyle {\tfrac {n(n+1)}{2}}} is square, then so is the larger {\displaystyle 4n(n+1)}th triangular number, since:
^
Pietenpol, J. L.; Sylwester, A. V.; Just, Erwin; Warten, R. M. (February 1962). "Elementary Problems and Solutions: E 1473, Square Triangular Numbers". American Mathematical Monthly. 69 (2). Mathematical Association of America: 168–169. doi:10.2307/2312558. ISSN0002-9890. JSTOR2312558.
^Plouffe, Simon (August 1992). "1031 Generating Functions"(PDF). University of Quebec, Laboratoire de combinatoire et d'informatique mathématique. p. A.129. Archived from the original(PDF) on 2012年08月20日. Retrieved 2009年05月11日.