Pentagonal Number Calculator

Enter an index n to compute the nth pentagonal number.

How it is calculated

The nth pentagonal number is P(n) = n × (3n - 1) / 2, where n is a whole-number position in the sequence 1, 5, 12, 22, 35 and so on. The tool also reports the gap from the previous term, P(n) - P(n-1), which always equals 3n - 2, so each step grows by 3 more than the one before.

The input is rounded to the nearest whole number first, so 7.6 is treated as 8. The index must be at least 1: 0, negative numbers and text return no result, so the tool does not produce the zero or negative-index values used in Euler's generalised pentagonal numbers. For n = 1 the gap shown is 1, because the previous term is taken to be 0. Large indices work, with results shown with thousands separators.

Worked example

Take n = 10. First compute 3n - 1 = 29. Multiply by n: 10 × 29 = 290. Divide by 2: 145, the tenth pentagonal number. For the gap, the ninth term is 9 × 26 / 2 = 117, so the tenth is 145 - 117 = 28 larger. That matches the shortcut 3n - 2 = 3 × 10 - 2 = 28. The index shown back is 10.

Try this example →

Common mistakes

  • Counting from zero. The first pentagonal number is P(1) = 1, so P(0) is not accepted; the tenth number is n = 10, not n = 9.
  • Confusing the formula with the triangular or square number. Triangular is n(n+1)/2 and square is n², so P(4) = 22, not 10 or 16.
  • Entering a fractional index. The tool rounds it to the nearest whole number, so 7.6 silently gives the 8th number.
  • Using the result as a count of dots in a single pentagon outline. It counts all dots in the nested pattern; the newest outer layer is the gap value, 3n - 2.
  • Expecting Euler's generalised pentagonal numbers. Those also use zero and negative n, which this tool does not accept.

About this calculator

A pentagonal number is a figurate number that counts dots arranged in the shape of a nested pentagon, generated by the formula P(n) = n(3n − 1) ÷ 2. The sequence begins 1, 5, 12, 22, 35, 51... and, like triangular and square numbers, each term can be visualized as building outward layer by layer from a central point.

Pentagonal numbers are a standard topic in recreational and number theory, most famously appearing in Euler's pentagonal number theorem, which links them to the generating function for integer partitions. Students and math enthusiasts use a calculator like this to explore the sequence quickly, while the underlying identity has real applications in combinatorics and the study of partition functions.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    This tool goes from the index to the value, but you can test the other way by hand. A number x is pentagonal when (1 + the square root of 1 + 24x) divided by 6 is a whole number. For 145 that gives (1 + 59) divided by 6, which is 10, matching the tenth term the tool returns. Try it on 51 and on 52 and compare. Which other figurate numbers, such as hexagonal or heptagonal, would you like to see here?

Popular calculators

All Calculators