A polygonal number is a type of figurate number that is a generalization of triangular, square,
etc., to a polygon with sides, where
is an integer. The above
diagrams graphically illustrate the process by which the polygonal numbers are built
up. Starting with the
th
triangular number
, then
|
(1)
|
Now note that
|
(2)
|
gives the th
square number,
|
(3)
|
gives the th
pentagonal number, and so on. The general polygonal
number can be written in the form
|
(4)
| |||
|
(5)
|
where
is the
th
-gonal number, with
a nonnegative integer
(Savin 2000). For example, taking
in (5) gives a triangular
number,
gives a square number, etc.
Polygonal numbers are implemented in the Wolfram Language as PolygonalNumber[r,
n], while PolygonalNumber[n]
gives the th
triangular number.
Call a positive integer -highly polygonal if it is
-gonal for at least
distinct values of
in the range from 3 to a specified limit. For
, the first few 2-highly polygonal numbers are
1, 6, 9, 10, 12, 15, 16, 21, 28, ... (OEIS A090428).
Similarly, the first few 3-highly polygonal numbers for
are 1, 15, 36, 45, 325, 561, 1225, 1540, 3025,
... (OEIS A062712). There are no 4-highly polygonal
numbers of this type less than
except for 1.
The generating function for the -gonal numbers is
|
(6)
|
for .
Fermat proposed that every positive integer is expressible as at most
-gonal numbers (Fermat's
polygonal number theorem). Fermat claimed to have a proof of this result, although
this proof has never been found. Jacobi, Lagrange (in 1772), and Euler all proved
the square case, and Gauss proved the triangular case in 1796. In 1813, Cauchy proved
the proposition in its entirety.
A positive integer can be tested for being
-gonal using the identity
|
(7)
|
so
must be a perfect square. Taking
to be its nonnegative square
root and solving
|
(8)
|
gives
|
(9)
|
The number
is
-gonal
iff this value of
is a positive integer.
Being a perfect square alone is not sufficient.
For
,
an
-gonal
number is equal to the sum of the
-gonal number of the same index and the triangular
number of the previous index.