Centered hexagonal number

From HandWiki
Short description: Number that represents a hexagon with a dot in the center

In mathematics and combinatorics, a centered hexagonal number, or hex number,[1][2] 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 following figures illustrate this arrangement for the first four centered hexagonal numbers:

1 7 19 37
+1 +6 +12 +18
* * 16px|*
16px|* 16px|* 16px|*
16px|* 16px|*
* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|*
* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|* 16px|*
16px|* 16px|* 16px|* 16px|*

Centered hexagonal numbers should not be confused with cornered hexagonal numbers, which are figurate numbers in which the associated hexagons share a vertex.

The sequence of hexagonal numbers starts out as follows (sequence A003215 in the OEIS):

1, 7, 19, 37, 61, 91, 127, 169, 217, 271, 331, 397, 469, 547, 631, 721, 817, 919.


Dissection of hexagonal number into six triangles with a remainder of one. The triangles can be re-assembled pairwise to give three parallelograms of n(n−1) dots each.

The nth centered hexagonal number is given by the formula[2]

[math]\displaystyle{ H(n) = n^3 - (n-1)^3 = 3n(n-1)+1 = 3n^2 - 3n +1. \, }[/math]

Expressing the formula as

[math]\displaystyle{ H(n) = 1+6\left(\frac{n(n-1)}{2}\right) }[/math]

shows that the centered hexagonal number for n is 1 more than 6 times the (n − 1)th triangular number.

In the opposite direction, the index n corresponding to the centered hexagonal number [math]\displaystyle{ H = H(n) }[/math] can be calculated using the formula

[math]\displaystyle{ n=\frac{3+\sqrt{12H-3}}{6}. }[/math]

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.

Recurrence and generating function

The centered hexagonal numbers [math]\displaystyle{ H(n) }[/math] satisfy the recurrence relation[2]

[math]\displaystyle{ H(n+1) = H(n) + 6n. }[/math]

From this we can calculate the generating function [math]\displaystyle{ F(x) = \sum_{n \ge 0} H(x) x^n }[/math]. The generating function satisfies

[math]\displaystyle{ F(x) = x + xF(x) + \sum_{n \ge 2} 6n x^n. }[/math]

The latter term is the Taylor series of [math]\displaystyle{ \frac{6x}{(1-x)^2} - 6x }[/math], so we get

[math]\displaystyle{ (1 - x) F(x) = x + \frac{6x}{(1-x)^2} - 6x = \frac{x + 4x^2 + x^3}{(1-x)^2} }[/math]

and end up at

[math]\displaystyle{ F(x) = \frac{x + 4x^2 + x^3}{(1-x)^3}. }[/math]


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. In base 6 the rightmost digit is always 1: 16, 116, 316, 1016, 1416, 2316, 3316, 4416... This follows from the fact that every centered hexagonal number modulo 6 (=106) equals 1.

The sum of the first n centered hexagonal numbers is n3. That is, centered hexagonal pyramidal numbers and cubes are the same numbers, but they represent different shapes. 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. (This can be seen geometrically from the diagram.) In particular, prime centered hexagonal numbers are cuban primes.

The difference between (2n)2 and the nth centered hexagonal number is a number of the form 3n2 + 3n − 1, while the difference between (2n − 1)2 and the nth centered hexagonal number is a pronic number.


Centered hexagonal numbers have practical applications in packing problems. They arise when packing round items into larger round containers, such as Vienna sausages into round cans, or combining individual wire strands into a cable.


  1. Hindin, H. J. (1983). "Stars, hexes, triangular numbers and Pythagorean triples". J. Rec. Math. 16: 191–193. 
  2. 2.0 2.1 2.2 Deza, Elena; Deza, M. (2012) (in en). Figurate Numbers. World Scientific. pp. 47–55. ISBN 978-981-4355-48-3. 

See also