Heptagonal Number Calculator

Find the heptagonal figurate number at an index from the formula n times five n minus three over two.

Math and PercentUpdated 2026-11-182 min read
Heptagonal Number Calculator
A whole number from 0 to 100,000.
Heptagonal number
...
Previous term...
Growth from previous...

What it does

Heptagonal numbers are figurate numbers built from a seven sided polygon. The nth term counts dots in a nested arrangement whose outer layer has seven sides. The sequence begins 0, 1, 7, 18, 34 and 55, and each term is given by a short quadratic formula.

Polygonal numbers generalize triangular and square numbers to any number of sides. For a polygon with s sides the formula is n times (s minus two) times n minus (s minus four), all divided by two. Setting s equal to seven gives the heptagonal formula used here.

Because the formula is quadratic, these numbers grow like a constant times n squared. That makes the ratio of consecutive terms approach one as the index increases, even though the absolute gap keeps growing.

This page evaluates the closed formula with exact integer arithmetic and reports the previous term and ratio beside the result. The division by two is always exact for whole n, and the tool checks it before returning an answer.

The index limit is one hundred thousand. The result then has about ten digits and is printed in full without scientific notation.

How to use

  1. Enter an index n from 0 to 100,000.
  2. Read the heptagonal number in the main result box.
  3. Check the previous term and growth beside it.
  4. The default index 6 reproduces the worked example.
  5. Try n = 5 to confirm the value 55.
  6. Compare with pentagonal numbers to see how the side count changes the formula.

Formula

H(n) = n x (5n - 3) / 2
n
The index, or layer count, of the figure.
H(n)
The heptagonal number at that index.

The general polygonal formula is n times (s minus two) times n minus (s minus four), divided by two, where s is the number of sides. Substituting seven gives five n minus three inside the parentheses. The value at n = 1 is one and the value at n = 0 is zero.

Worked example

Example: index 6

The page opens with n = 6.

  1. Write the formula: H(6) = 6 x (5 x 6 - 3) / 2.
  2. Compute five times six: 30.
  3. Subtract three: 30 - 3 = 27.
  4. Multiply by six: 6 x 27 = 162.
  5. Divide by two: 162 / 2 = 81.
  6. The tool reports 81, previous term 55, and growth 1.47x.
  7. Check the previous term: 5 x (25 - 3) / 2 = 55.

Reference table

Heptagonal numbers at small indices
nH(n)PreviousGrowth
00n/an/a
110n/a
2717.00x
434181.89x
555341.62x
681551.47x

Limits

  • Indices above 100,000 are rejected to keep the output readable.
  • The growth column is rounded to two decimals.
  • The tool computes the number, not a drawing of the polygon.
  • Only the standard heptagonal offset starting at zero is used.

Common mistakes

  • Using six or eight in place of seven in the general formula.
  • Forgetting to divide by two.
  • Placing the first nonzero term at index one without checking the convention.
  • Assuming the gap between terms is linear when it is quadratic.
  • Rounding the intermediate half instead of dividing exactly.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is H(6)?

H(6) = 6 x 27 / 2 = 81.

What is H(5)?

H(5) = 5 x 22 / 2 = 55.

What is H(2)?

H(2) = 2 x 7 / 2 = 7.

Questions

What is a heptagonal number?

A figurate number whose dots form nested seven sided polygons.

What is the general polygonal formula?

n times (s minus two) times n minus (s minus four), divided by two, for s sides.

Why is the first value zero?

The standard indexing includes n equals zero, where the formula gives zero.

How fast do these grow?

Like five halves of n squared, so the sequence is quadratic.

Are values exact?

Yes. The division by two is exact and the rest is integer multiplication.

What index range is accepted?

Zero through 100,000.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.