A centered hexagonal number, or hex number, is a centered figurate number that represents a hexagon with a dot in the center and all other dots surrounding the center dot in a hexagonal lattice.
The nth centered hexagonal number is given by the formula
Expressing the formula as
shows that the centered hexagonal number for n is 1 more than 6 times the (n − 1)th triangular number.
The first few centered hexagonal numbers are (sequence A003215 in OEIS):
1, 7, 19, 37, 61, 91, 127, 169, 217, 271, 331, 397, 469, 547, 631, 721, 817, 919.
In base 10 one can notice that the hexagonal numbers' rightmost...