Hexagonal Number Calculator

Get the nth hexagonal number.

How it is calculated

Enter the position n in the sequence (a whole number, 1 or more). The tool computes H(n) = n × (2n − 1), which is the same as 2n² − n. Both factors are plain integers, so the answer is exact and shown with thousands separators. Positions that are zero, negative or not whole numbers (such as 2.5) return no result, because a hexagonal number only exists for n = 1, 2, 3 and so on. Very large n works too, since the result is just a product, but it grows quickly: roughly twice n squared.

Worked example

Take n = 12. First work out the second factor: 2 × 12 − 1 = 23. Then multiply by n: 12 × 23 = 276. So the 12th hexagonal number is 276. As a check, 276 is also the 23rd triangular number, because 23 × 24 / 2 = 276, which is what you get whenever you plug 2n − 1 into the triangular formula.

Try this example →

Common mistakes

  • Counting from zero: the first hexagonal number is H(1) = 1, so n = 6 gives 66, not the value you would get by treating the list as starting at index 0.
  • Using the formula for a different polygon, for example n(n + 1)/2 (triangular) or n² (square), when the task asks for hexagonal numbers.
  • Typing a fraction or zero for n and expecting a value; only positive whole positions are accepted.
  • Forgetting the brackets and computing n × 2n − 1 instead of n × (2n − 1), which is off by n − 1.

About this calculator

A hexagonal number counts the dots needed to build nested hexagonal patterns, given by the formula n(2n−1): 1, 6, 15, 28, 45, and so on. Hexagonal numbers belong to the broader family of figurate (or polygonal) numbers, alongside triangular and square numbers, and they hold a neat structural secret — every hexagonal number is also a triangular number, specifically every other one in the triangular sequence (the 1st, 3rd, 5th... triangular numbers).

Number theory courses use hexagonal numbers to illustrate how figurate-number identities connect seemingly unrelated sequences, and they surface famously in the theory of perfect numbers: every even perfect number (6, 28, 496...) is also a hexagonal number, a fact tied back to Euclid’s formula for even perfect numbers. Beyond pure math, the same n(2n−1) packing logic describes hexagonal close-packing arrangements used when counting objects arranged in expanding hexagonal rings, such as cells around a honeycomb center.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators