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 0, 1, 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056, 1882672131025 (sequence A001110 in OEIS).
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 to be
. From this definition and the quadratic formula,
Therefore,
is triangular if and only if
is square, and naturally
is square and triangular if and only if
is square, i. e., there are numbers
and
such that
. 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
. If
denotes the k'th non-trivial solution to any Pell equation for a particular n, it can be shown by the method of descent that
and
. 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
to the Pell equation for n=8 yields a square triangular number and its square and triangular roots as follows:
and
Hence, the first square triangular number, derived from (3,1), is 1, and the next, derived from (17,6) (=6×(3,1)-(1,0)), is 36.
A triangular number or triangle number counts the objects that can form an equilateral triangle, as in the diagram on the right. The nth triangular number is the number of dots composing a triangle with n dots on a side, and is equal to the sum of the n natural numbers from 1 to n. The sequence of triangular numbers (sequence A000217 in OEIS), starting at the 0th triangular number, is:
The triangle numbers are given by the following explicit formulas:
where is a binomial coefficient. It represents the number of distinct pairs that can be selected from n + 1 objects, and it is read aloud as "n plus one choose two".
Carl Friedrich Gauss is said to have found this relationship in his early youth, by multiplying n/2 pairs of numbers in the sum by the values of each pair n + 1. However, regardless of the truth of this story, Gauss was not the first to discover this formula, and some find it likely that its origin goes back to the Pythagoreans 5th century BC.
The triangular number Tn solves the "handshake problem" of counting the number of handshakes if each person in a room with n + 1 people shakes hands once with each person. In other words, the solution to the handshake problem of n people is Tn−1. The function T is the additive analog of the factorial function, which is the products of integers from 1 to n.