In the opposite direction, the index n corresponding to the centered hexagonal number
can be calculated using the formula This can be used as a test for whether a number H is centered hexagonal: it will be if and only if the above expression is an integer.
The generating function satisfies The latter term is the Taylor series of
, so we get and end up at In base 10 one can notice that the hexagonal numbers' rightmost (least significant) digits follow the pattern 1–7–9–7–1 (repeating with period 5).
This follows from the last digit of the triangle numbers (sequence A008954 in the OEIS) which repeat 0-1-3-1-0 when taken modulo 5.
This follows from the fact that every centered hexagonal number modulo 6 (=106) equals 1.
Viewed from the opposite perspective, centered hexagonal numbers are differences of two consecutive cubes, so that the centered hexagonal numbers are the gnomon of the cubes.