Pentagonal Number Calculator
Input
- Pentagonal numbers count the dots in nested pentagons: each new layer adds a growing border around the previous figure.
- The formula is P(n) = n x (3n - 1) / 2, so P(5) = 5 x 14 / 2 = 35.
- Neighbouring values are P(4) = 22 and P(6) = 51; the gap between consecutive pentagonal numbers grows by 3 each time.
- Generalized pentagonal numbers, from both n and -n, are the exponents in Euler's pentagonal theorem for the partition function.
This pentagonal number calculator finds the pentagonal number at any position you choose. Pentagonal numbers count the dots in nested pentagonal arrangements, and the formula is P(n) = n(3n - 1)/2. The sequence begins 1, 5, 12, 22, 35, so the fifth pentagonal number is 35. Enter a position and the calculator returns that pentagonal number directly: P(10) = 145 and P(12) = 210. It also shows how the sequence grows. The gap between consecutive pentagonal numbers grows by 3 each time, and the gap at P(5) is 13.
The method behind the calculator is the standard closed formula, P(n) = n(3n - 1)/2, which is the accepted way to compute pentagonal numbers because it gives the exact value for any position without building the sequence dot by dot. The page also covers generalized pentagonal numbers, which take both n and -n and appear as the exponents in Euler's pentagonal theorem for partitions. Alongside the answer, this page shows the formula, step-by-step workings, worked examples and sources, so you can check each result yourself rather than trusting a black box.
Worked examples
Fifth pentagonal number
(5)
| Pentagonal number P(5) | 35 |
| Previous value P(4) | 22 |
| Next value P(6) | 51 |
| Gap to the previous value (3n - 2) | 13 |
Tenth pentagonal number
(10)
| Pentagonal number P(10) | 145 |
| Previous value P(9) | 117 |
| Next value P(11) | 176 |
| Gap to the previous value (3n - 2) | 28 |
Twelfth pentagonal number
(12)
| Pentagonal number P(12) | 210 |
| Previous value P(11) | 176 |
| Next value P(13) | 247 |
| Gap to the previous value (3n - 2) | 34 |
Dots in nested pentagons
Picture pentagonal numbers as dots laid out in pentagons that sit inside one another, each layer wrapped around the one before it. The first pentagonal number is a single dot, P(1) = 1. Add a second layer and you get 5 dots: the original dot plus four new ones placed around it. The third layer brings the count to 12, the fourth to 22, and the fifth to 35. That opening run — 1, 5, 12, 22, 35 — is what a pentagonal number calculator produces when you step through n = 1 to 5, and each term is simply the previous term plus the dots in the newest ring.
The formula P(n) = n(3n - 1)/2 describes exactly that construction. Read the two factors separately. The n counts how many pentagons you are nesting — how many layers deep the figure goes. The (3n - 1)/2 part counts the dots in the outermost ring, the layer added when you move from P(n - 1) to P(n). So the closed form is not an arbitrary piece of algebra; it is a bookkeeping rule for a drawing you could make on paper, one ring at a time.
The rings explain why the gaps behave the way they do. The difference between consecutive pentagonal numbers grows by 3 each time. Going from P(4) = 22 to P(5) = 35 adds 13 dots, and the gap at P(5) is 13; the next gap is 16, then 19, and so on. Each new pentagon has one more dot per side than the last, and three sides contribute the extra 3. This is why the numbers pull away from each other faster than the square numbers do, and why a pentagonal number calculator is handy once n gets past the point where you want to count rings by hand. For example, P(10) = 145 and P(12) = 210.
The nesting idea also extends past the positive layers. Generalized pentagonal numbers take both n and -n, so the sequence picks up a second, mirrored branch of values. Those generalized numbers are the exponents in Euler's pentagonal theorem for partitions — a result about breaking whole numbers into sums, where the pentagonal values appear as the exponents in an infinite product. The same figures that begin as dots in nested pentagons turn up in a completely different corner of number theory.
- P(1) = 1: a single dot
- P(2) = 5: one dot plus a ring of four
- P(3) = 12: the previous figure plus a new ring
- P(4) = 22: the next ring adds 10
- P(5) = 35: the gap from P(4) is 13
Values and gaps
A pentagonal number calculator is easiest to trust when you can see the values it produces and check them by hand. Pentagonal numbers count the dots in nested pentagonal arrangements, and the formula behind them is P(n) = n(3n - 1)/2. Starting from n = 1, the sequence opens 1, 5, 12, 22, 35. That fifth term matters as a checkpoint: the fifth pentagonal number is 35, so if a tool gives you anything else for n = 5, something is off.
The table below lists the early values through P(12) = 210. Two entries are given directly in the source material: P(10) = 145 and P(12) = 210. The rest follow from the formula, and each one can be verified with a quick multiplication and division. Notice how quickly the numbers climb — by the twelfth term you are already past 200, even though the first term is just 1.
The more interesting pattern is in the gaps between consecutive values. The gap between consecutive pentagonal numbers grows by 3 each time. At P(5), the gap is 13 — the step from 22 to 35. From there the steps widen steadily: 16, 19, 22, and so on, each one exactly 3 larger than the one before. This is why the sequence accelerates rather than rising in a straight line. The values themselves grow quadratically, and the gaps grow linearly, adding 3 at every step.
That steady widening is a useful sanity check on any result. If you compute a pentagonal number and the difference from the previous term is not 3 more than the previous difference, the arithmetic has gone wrong somewhere. Working backward from a known value is just as reliable: subtract the expected gap and you should land on the prior pentagonal number.
One related idea is worth knowing. Generalized pentagonal numbers, taking both n and -n, are the exponents in Euler's pentagonal theorem for partitions. That connection is separate from the ordinary sequence above, but it explains why pentagonal numbers turn up in unexpected corners of number theory.
- The sequence begins 1, 5, 12, 22, 35 — the fifth pentagonal number is 35.
- P(10) = 145 and P(12) = 210.
- The gap between consecutive pentagonal numbers grows by 3 each time.
- The gap at P(5) is 13, the step from 22 to 35.
- Generalized pentagonal numbers, taking both n and -n, are the exponents in Euler's pentagonal theorem for partitions.
| n | Pentagonal number P(n) | Gap from previous |
|---|---|---|
| 1 | 1 | — |
| 2 | 5 | 4 |
| 3 | 12 | 7 |
| 4 | 22 | 10 |
| 5 | 35 | 13 |
| 10 | 145 | — |
| 12 | 210 | — |
Generalized pentagonal numbers
The pentagonal number calculator has so far dealt with the familiar sequence, where n is a positive whole number and P(n) = n(3n - 1)/2. But the formula does not care whether n is positive. Feed it a negative index and it still returns a whole number, and those extra values are what mathematicians call generalized pentagonal numbers. The idea is simple: take every index, both n and -n, and collect the results. The ordinary pentagonal numbers become one branch of a larger family, and the negative indices supply a second branch.
To see how the second branch works, try a negative index in the formula. For n = -1, the expression becomes -1 times (3(-1) - 1), all divided by 2, which works out to 2. For n = -2, the same arithmetic gives 5. Continuing with n = -3 and n = -4 produces 7 and 12. Notice that these values are not new kinds of numbers at all — they are ordinary pentagonal numbers in disguise. The negative branch simply revisits values the positive branch already reached, and it does so in a different order. That is why the generalized sequence is usually written as 1, 2, 5, 7, 12, 15 and so on, with the two branches interleaved.
Read that list carefully and the pattern becomes clear. The positive branch contributes 1, 5, 12, 22, 35, and the fifth pentagonal number is 35. The negative branch contributes 2, 7, 15, and further terms. Merged and sorted, the two branches give 1, 2, 5, 7, 12, 15, 22, and onward, which is exactly the sequence of generalized pentagonal numbers. A pentagonal number calculator that accepts a negative index will return these second-branch values directly, so you can check the list yourself: enter -1 and get 2, enter -2 and get 5, and so on. The ordinary values remain available too, such as P(10) = 145 and P(12) = 210.
The generalized sequence is not a curiosity. It appears in Euler's pentagonal theorem for partitions, where the generalized pentagonal numbers, taking both n and -n, serve as the exponents in that theorem. In other words, the second branch is not an afterthought bolted onto the definition; it is the reason the generalized numbers are studied at all. The same formula, run over positive and negative indices alike, produces the full list that the theorem depends on.
One caution when you use the calculator: the generalized list is not the same as the ordinary pentagonal sequence, even though every generalized number is a pentagonal number. The generalized list simply orders the values differently, mixing the two branches. If you want the classic sequence, keep n positive. If you want the interleaved list of 1, 2, 5, 7, 12, 15, allow negative indices as well.
- n = -1 gives 2, n = -2 gives 5, n = -3 gives 7, and n = -4 gives 12.
- The positive branch runs 1, 5, 12, 22, 35; the fifth pentagonal number is 35.
- Merged, the two branches give 1, 2, 5, 7, 12, 15, 22, and onward.
- The generalized pentagonal numbers, taking both n and -n, are the exponents in Euler's pentagonal theorem for partitions.
- The ordinary values are still available, for example P(10) = 145 and P(12) = 210.
Euler's pentagonal theorem
Euler's pentagonal theorem is the bridge between pentagonal numbers and one of the most famous counting problems in mathematics: integer partitions. A partition of a whole number is a way of writing it as a sum of positive integers, where order does not matter. For example, the number 4 has five partitions: 4, 3+1, 2+2, 2+1+1, and 1+1+1+1. Counting partitions gets hard quickly as the numbers grow, and that is where the pentagonal number calculator's underlying sequence earns its keep. Euler discovered that the pentagonal numbers — and their mirror images, the generalized pentagonal numbers — tell you exactly which earlier partition counts to add and which to subtract when building the next one.
The ordinary pentagonal numbers count the dots in nested pentagonal arrangements and follow the formula P(n) = n(3n - 1)/2. The sequence runs 1, 5, 12, 22, 35, so the fifth pentagonal number is 35. The gaps between consecutive terms grow by 3 each time; the gap at P(5) is 13. The generalized pentagonal numbers extend this by taking both n and -n, which produces a second, interleaved strand of values. These generalized numbers, not just the ordinary ones, are the exponents that appear in Euler's pentagonal theorem for partitions.
Euler's recurrence works like this: to find the partition count for a number, you look back at earlier partition counts whose positions are generalized pentagonal numbers away. The signs alternate in pairs — add, add, subtract, subtract — as you walk through the generalized pentagonal sequence. The generalized pentagonal numbers are precisely the offsets that decide which earlier partition counts to add and which to subtract. Because those offsets grow roughly with the square of an index, the recurrence reaches back only a modest distance even for large inputs, which is what makes it practical.
This is the connection a pentagonal number calculator makes visible. The same values it produces — 1, 5, 12, 22, 35, and onward to P(10) = 145 and P(12) = 210 — are the very numbers that organize the partition recurrence. The ordinary pentagonal numbers give the shape of the sequence; the generalized versions supply the signed offsets. So a tool built around P(n) = n(3n - 1)/2 is also, quietly, a tool for one of Euler's most elegant results.
FAQs
What is a pentagonal number?
A pentagonal number counts the dots in a nested pentagon figure with n dots on a side. The formula is P(n) = n(3n - 1)/2. So each pentagonal number is built from a growing pentagon pattern, and the formula lets you compute any term directly without drawing the figure.
What is the fifth pentagonal number?
The fifth pentagonal number is 35. Using the formula P(n) = n(3n - 1)/2 with n = 5 gives 5 x 14 / 2, which equals 35. That matches the dot count in a nested pentagon figure with 5 dots on a side.
What is P(10)?
P(10) is 145. For comparison, P(12) is 210, so the values climb quickly as n grows. You can confirm either result with the formula P(n) = n(3n - 1)/2: for n = 10 it gives 10 x 29 / 2, which is 145.
How do the gaps behave?
The gap between consecutive pentagonal numbers grows by 3 each time. Each gap is 3 more than the last. For example, the gap into P(5) is 13, and the gap into P(10) is 28. This steady increase of 3 is why the sequence accelerates rather than rising evenly.
What is a generalized pentagonal number?
A generalized pentagonal number applies the same formula at negative indices as well as positive ones. This produces the sequence 1, 2, 5, 7, 12, 15, and so on. These are exactly the numbers that appear in Euler's pentagonal theorem, which is why they carry the pentagonal name.
Are pentagonal numbers related to triangular numbers?
Yes. Every pentagonal number is a third of a triangular number with index 3n - 1. That relationship gives you a handy cross-check: compute the triangular number at 3n - 1, divide by 3, and you should get the pentagonal number P(n) from the standard formula.