A hexagonal number counts dots in a nested-hexagon pattern with a shared vertex. Starting with one dot:
H1=1,H2=6,H3=15,H4=28,H5=45,H6=66,…
The closed form is
Hn=n(2n−1)=2n2−n
Key identity. Every hexagonal number is also a triangular number:
Hn=T2n−1
This means hexagonal numbers are exactly the odd-indexed triangular numbers. H1=T1, H2=T3, H3=T5, H4=T7, and so on. The hexagonal numbers form a subsequence of triangular numbers.
Sum-of-arithmetic-series form.Hn=1+5+9+⋯+(4n−3), the sum of the first n terms of the arithmetic series with a1=1 and common difference d=4.
For deeper coverage see hexagonal number, polygonal numbers, and figurate numbers.
The Closed Form and the Triangular Connection
Closed form derivation. From the arithmetic-series perspective, Hn=∑k=1n(4k−3):
Hn=4⋅2n(n+1)−3n=2n2+2n−3n=2n2−n=n(2n−1)
The triangular identity. Substituting Tk=k(k+1)/2 with k=2n−1:
T2n−1=2(2n−1)(2n)=n(2n−1)=Hn
This identity says: stretch a triangular pattern by aligning every other row, and you get a hexagonal pattern with n "layers."
Why hexagonal numbers are exactly the odd-indexed triangulars. Triangulars with even index T2n give n(2n+1), not the hexagonal formula. So even-indexed triangulars (3, 10, 21, 36, ...) are not hexagonal; only odd-indexed ones are.
Examples of the identity. • H1=1=T1 • H2=6=T3 • H3=15=T5 • H4=28=T7 • H5=45=T9
The Membership Test
Given a positive integer m, deciding whether it is hexagonal requires two checks.
The test.m is hexagonal if and only if both:
1. 8m+1 is a perfect square, and 2. 1+8m+1 is divisible by 4.
If both hold, the index is
n=41+8m+1
Why both checks. Note that condition 1 (8m+1 is a perfect square) is the triangular test. So every hexagonal number is triangular (as expected). But not every triangular number is hexagonal — only those where 1+8m+1 is also divisible by 4. The divisibility check is what distinguishes odd-indexed triangulars (which are hexagonal) from even-indexed triangulars (which are not).
Example. Is 190 hexagonal? Compute 8⋅190+1=1521=392 — a perfect square. Then (1+39)/4=10, an integer. So 190=H10. Verify: 10⋅19=190. Confirmed.
Triangular but not hexagonal. Is 10 hexagonal? Compute 8⋅10+1=81=92 — perfect square, so 10 is triangular (10=T4). But (1+9)/4=10/4=2.5 — not an integer. So 10 is not hexagonal. Indeed T4 has even index 4, not odd.
Non-example. Is 100 hexagonal? Compute 8⋅100+1=801. Then 801≈28.3 — not a perfect square. So 100 is not triangular, hence not hexagonal.
Properties and Identities
• Recurrence: Hn=Hn−1+(4n−3) with H1=1. Each hexagonal adds the next arithmetic-series term. • Hexagonal-triangular: Hn=T2n−1. Hexagonal numbers are exactly the odd-indexed triangulars. • Sum of two consecutive triangulars: T2n−1+T2n−2 does not equal Hn in general; the relation between hexagonal and consecutive triangulars is just Hn=T2n−1. • Difference of consecutive hexagonals: Hn+1−Hn=4n+1. The differences are 5, 9, 13, 17, ... — the arithmetic series. • Generating function: ∑n=1∞Hnxn=(1−x)3x(1+3x). • Asymptotic growth: Hn∼2n2. Hexagonal numbers grow about twice as fast as square numbers. • Last-digit pattern: hexagonal numbers in base 10 end only in 0, 1, 5, 6, 8, or rarely with other digits depending on the index parity. • Density within triangulars: among the first N triangular numbers, about N/2 are hexagonal (the odd-indexed ones).
Hexagonal Numbers vs Centered Hexagonal Numbers
An important distinction: "hexagonal numbers" in the traditional sense (described here) differ from centered hexagonal numbers.
Hexagonal numbers (this explorer): nested hexagons sharing one vertex. Closed form Hn=n(2n−1). Sequence: 1, 6, 15, 28, 45, 66, ...
Centered hexagonal numbers: hexagons with a center dot, surrounded by concentric hexagonal layers. Closed form Cn=3n(n−1)+1. Sequence: 1, 7, 19, 37, 61, 91, ... These count atoms in 2D close-packed structures.
The two sequences are sometimes confused but represent different geometric patterns:
• Hexagonal Hn: shares a single corner vertex with the previous hexagon; less symmetric pattern. • Centered hexagonal Cn: builds concentric rings around a central point; the canonical pattern for close-packed circles or atoms.
This page covers the traditional polygonal hexagonal numbers following the polygonal family. For centered hexagonal numbers, see a separate dedicated tool.
Common Applications
• Triangular subsequence. Whenever odd-indexed triangulars are needed (in identities, partial sums, or combinatorial problems), hexagonal numbers are the direct shortcut. • Hexagonal patterns in nature. Although the most famous hexagonal patterns (honeycomb, snowflakes) align more with centered hexagonals or hexagonal lattices, the polygonal hexagonal sequence still appears in counting problems on hexagonal regions. • Combinatorics.Hn=(22n)/2 gives an unusual binomial-coefficient identity (this is Hn=T2n−1 in disguise via Tk=(2k+1)). • Partition theory. Hexagonal numbers appear in some partition-counting identities, though pentagonal numbers play the more prominent role. • Recreational mathematics. Hexagonal numbers are studied alongside triangular and square numbers in figurate-number puzzles and problems. • Number theory. Many results about polygonal numbers (Fermat's polygonal number theorem, for instance) include hexagonal as a special case.
Common Mistakes
• Confusing hexagonal with centered hexagonal numbers. The two sequences look superficially similar (both start with 1) but diverge: hexagonal gives 1, 6, 15, 28; centered hexagonal gives 1, 7, 19, 37. Always check which definition is intended.
• Forgetting the divisibility-by-4 check.8m+1 being a perfect square means m is triangular, but not necessarily hexagonal. The divisibility-by-4 condition on 1+8m+1 filters to odd-indexed triangulars. Example: 10=T4 is triangular but not hexagonal; (1+9)/4=2.5.
• Misremembering the closed form.Hn=n(2n−1), not n(2n+1) or 2n(n−1). The minus sign matters.
• Confusing the hexagonal-triangular relation.Hn=T2n−1, not T2n or Tn+1. The index in the triangular sequence is odd: 2n−1.
• Confusing with hexagonal pyramidal numbers. The 3D analog HPn=n(n+1)(4n−1)/6 counts dots in a hexagonal pyramid, not a flat hexagon. Different sequence, different formula.
• Treating the membership test as equivalent to the triangular test. Triangular membership uses one condition; hexagonal requires two. Skipping the divisibility check misclassifies even-indexed triangulars as hexagonal.
Related Sequences and Concepts
Triangular Numbers — Tn=n(n+1)/2. Hexagonal numbers are the odd-indexed subsequence: Hn=T2n−1.
Square Numbers — Sn=n2. Hexagonal numbers grow about twice as fast.
Pentagonal Numbers — Pn=n(3n−1)/2. The previous polygonal-number sequence in the family.
Heptagonal Numbers — Hpn=n(5n−3)/2. The next polygonal-number sequence.
Octagonal Numbers — On=n(3n−2). Two steps further in the polygonal family.
Centered Hexagonal Numbers — Cn=3n(n−1)+1. A different but related sequence; counts close-packed circles in concentric hexagonal rings.
Polygonal Numbers — the general family. Hexagonal is the r=6 case in Pn(r)=n[(r−2)n−(r−4)]/2.
Hexagonal Pyramidal Numbers — the 3D analog: HPn=n(n+1)(4n−1)/6. Counts dots in a hexagonal pyramid.
Fermat Polygonal Number Theorem — every positive integer is a sum of at most rr-gonal numbers. Conjectured by Fermat, proved by Lagrange (squares), Gauss (triangulars), and Cauchy (general).
Arithmetic Series — Hn is the sum of the first n terms of the arithmetic series 1,5,9,13,… with d=4.
Figurate Numbers — the umbrella family. Hexagonal numbers are 2D, 6-sided.
Hexagonal Lattice — the regular lattice of hexagons; relevant to centered hexagonals more than to polygonal hexagonals, but worth knowing in context.