The number 10 for example, can be arranged as a triangle : But 10 cannot be arranged as a square. The number 9, on the other hand, can be : Some numbers, like 36, can be arranged both as a square and as a triangle : By convention, 1 is the first polygonal number for any number of sides. The rule for enlarging the polygon to the next size is to extend two adjacent arms by one point and to then add the required extra sides between those points. In the following diagrams, each extra layer is shown as in red.
Triangular numbers
Square numbers
Polygons with higher numbers of sides, such as pentagons and hexagons, can also be constructed according to this rule, although the dots will no longer form a perfectly regular lattice like above.
Pentagonal numbers
Hexagonal numbers
Formula
If is the number of sides in a polygon, the formula for the th -gonal number is or The th -gonal number is also related to the triangular numbers as follows: Thus: For a given -gonal number, one can find by and one can find by
Applying the formula above: to the case of 6 sides gives: but since: it follows that: This shows that the th hexagonal number is also the th triangular number. We can find every hexagonal number by simply taking the odd-numbered triangular numbers:
Table of values
The first 6 values in the column "sum of reciprocals", for triangular to octagonal numbers, come from a published solution to the general problem, which also gives a general formula for any number of sides, in terms of the digamma function. The On-Line Encyclopedia of Integer Sequences eschews terms using Greek prefixes in favor of terms using numerals. A property of this table can be expressed by the following identity : with
Combinations
Some numbers, such as 36 which is both square and triangular, fall into two polygonal sets. The problem of determining, given two such sets, all numbers that belong to both can be solved by reducing the problem to Pell's equation. The simplest example of this is the sequence of square triangular numbers. The following table summarizes the set of -gonal -gonal numbers for small values of and. In some cases, such as and, there are no numbers in both sets other than 1. The problem of finding numbers that belong to three polygonal sets is more difficult. A computer search for pentagonal square triangular numbers has yielded only the trivial value of 1, though a proof that there are no other such numbers has yet to be found. The number 1225 is hecatonicositetragonal, hexacontagonal, icosienneagonal, hexagonal, square, and triangular. The only polygonal set that is contained entirely in another polygonal set is the set of hexagonal numbers, which is contained in the set of triangular numbers.