Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Pentagonal Numbers Calculator






What is a Pentagonal Number?

A pentagonal number counts dots in a nested-pentagon pattern. Starting with a single dot, each next pentagon shares two sides with the previous one and adds a new layer of dots:

P1=1,P2=5,P3=12,P4=22,P5=35,P6=51,P_1 = 1, \quad P_2 = 5, \quad P_3 = 12, \quad P_4 = 22, \quad P_5 = 35, \quad P_6 = 51, \quad \ldots


The closed form is

Pn=n(3n1)2P_n = \frac{n(3n - 1)}{2}


Pentagonal numbers are the third in the family of polygonal numbers (after triangular and square). The general rr-gonal-number formula

Pn(r)=n[(r2)n(r4)]2P_n^{(r)} = \frac{n[(r - 2)n - (r - 4)]}{2}


specializes to the pentagonal case at r=5r = 5.

Sum-of-arithmetic-series form. Pn=1+4+7+10++(3n2)P_n = 1 + 4 + 7 + 10 + \cdots + (3n - 2), the sum of the first nn terms of the arithmetic series with a1=1a_1 = 1 and common difference d=3d = 3. The first term 1 and the step 3 reflect the geometry: the first pentagon has 1 dot, and each new layer adds 3 dots times nn minus an adjustment for the shared vertex.

For deeper coverage see pentagonal number, polygonal numbers, and Euler's pentagonal number theorem.

The Closed Form Derivation

From the arithmetic-series perspective. Pentagonal numbers are sums of the arithmetic series 1,4,7,10,1, 4, 7, 10, \ldots, where each term is 3k23k - 2 for k=1,2,,nk = 1, 2, \ldots, n. The sum is

Pn=k=1n(3k2)=3k=1nk2n=3n(n+1)22nP_n = \sum_{k=1}^{n} (3k - 2) = 3 \sum_{k=1}^{n} k - 2n = 3 \cdot \frac{n(n+1)}{2} - 2n


Simplifying:

Pn=3n2+3n4n2=3n2n2=n(3n1)2P_n = \frac{3n^2 + 3n - 4n}{2} = \frac{3n^2 - n}{2} = \frac{n(3n - 1)}{2}


From the general $r$-gonal formula. Substituting r=5r = 5 into

Pn(r)=n[(r2)n(r4)]2P_n^{(r)} = \frac{n[(r-2)n - (r-4)]}{2}


gives Pn(5)=n(3n1)/2P_n^{(5)} = n(3n - 1)/2.

Why the formula is always an integer. Among any two consecutive integers, one is even. Either nn is even, or 3n13n - 1 is even (since 3n3n has the same parity as nn). So n(3n1)n(3n - 1) is always even.

The Membership Test

Given a positive integer mm, testing whether it is pentagonal requires two checks.

The test. mm is pentagonal if and only if both:

1. 24m+124m + 1 is a perfect square, and
2. 1+24m+11 + \sqrt{24m + 1} is divisible by 6.

If both hold, the index is

n=1+24m+16n = \frac{1 + \sqrt{24m + 1}}{6}


Why both checks are needed. From Pn=n(3n1)/2=mP_n = n(3n - 1)/2 = m, the quadratic 3n2n2m=03n^2 - n - 2m = 0 has discriminant 1+24m1 + 24m, which must be a perfect square. But the quadratic formula gives n=(1±24m+1)/6n = (1 \pm \sqrt{24m + 1})/6, and we need nn to be a positive integer, hence the divisibility condition.

Example. Is 117 pentagonal? Compute 24117+1=2809=53224 \cdot 117 + 1 = 2809 = 53^2 — a perfect square. Then (1+53)/6=9(1 + 53)/6 = 9, an integer. So 117=P9117 = P_9. Verify: 926/2=1179 \cdot 26 / 2 = 117. Confirmed.

Non-example. Is 50 pentagonal? Compute 2450+1=120124 \cdot 50 + 1 = 1201. Then 120134.66\sqrt{1201} \approx 34.66 — not a perfect square. So 50 is not pentagonal. The nearest are P5=35P_5 = 35 and P6=51P_6 = 51.

Edge case where check 1 passes but check 2 fails. If 24m+124m + 1 happens to be a perfect square but the resulting 1+s1 + s is not divisible by 6, the candidate index would be fractional. The divisibility check rejects these.

Properties and Identities

Recurrence: Pn=Pn1+(3n2)P_n = P_{n-1} + (3n - 2) with P1=1P_1 = 1. Each pentagonal number adds the next arithmetic-series term.
Generating function: n=0Pnxn=x(1+x)(1x)3\sum_{n=0}^{\infty} P_n x^n = \frac{x(1 + x)}{(1 - x)^3}. The pentagonal numbers' generating function is a rational function.
Connection to triangulars: Pn=T3n1Tn1P_n = T_{3n-1} - T_{n-1}, where TkT_k is the kk-th triangular number. A pentagonal number is a difference of two triangulars.
Connection to hexagonal numbers: every hexagonal number HnH_n relates to a pentagonal number, though the correspondence is not as clean as Hn=T2n1H_n = T_{2n-1} for triangulars.
Asymptotic growth: Pn3n22P_n \sim \frac{3n^2}{2} as nn \to \infty. Pentagonal numbers grow as the square of the index.
Last-digit pattern: pentagonal numbers in base 10 end only in 0, 1, 2, 5, 6, or 7. Numbers ending in 3, 4, 8, or 9 cannot be pentagonal.

Euler's Pentagonal Number Theorem

Pentagonal numbers' most famous mathematical role is in Euler's pentagonal number theorem, a foundational result in the theory of integer partitions.

The theorem. For all formal power series:

n=1(1xn)=k=(1)kxk(3k1)/2\prod_{n=1}^{\infty}(1 - x^n) = \sum_{k = -\infty}^{\infty} (-1)^k x^{k(3k - 1)/2}


The exponents on the right are exactly the generalized pentagonal numbers 0,1,2,5,7,12,15,22,26,0, 1, 2, 5, 7, 12, 15, 22, 26, \ldots, obtained by letting kk range over all integers (positive, zero, negative) in the formula k(3k1)/2k(3k - 1)/2.

The combinatorial meaning. The left side is the generating function for the difference between the number of partitions of nn into an even number of distinct parts and the number into an odd number of distinct parts. Euler's theorem says this difference is 00 except when nn is a generalized pentagonal number, in which case it is ±1\pm 1.

Why it matters. The reciprocal 1/(1xn)1 / \prod (1 - x^n) is the generating function for the partition function p(n)p(n). Euler's theorem gives a recurrence:

p(n)=p(n1)+p(n2)p(n5)p(n7)+p(n12)+p(n15)p(n) = p(n - 1) + p(n - 2) - p(n - 5) - p(n - 7) + p(n - 12) + p(n - 15) - \cdots


The signs follow a ++++++--++-- pattern, and the subtractions stop when the argument goes negative. This is the fastest classical recurrence for the partition function — computing p(100)p(100) requires only about 15 terms.

Common Applications

Integer partitions. As shown above, pentagonal numbers control the partition function via Euler's recurrence. Any algorithm computing p(n)p(n) efficiently goes through pentagonal numbers.
Modular forms. The product (1xn)=η(τ)/x1/24\prod (1 - x^n) = \eta(\tau)/x^{1/24} (up to a factor) is the Dedekind eta function, a basic modular form. Pentagonal numbers appear in its qq-expansion.
Combinatorial identities. Many partition identities, including Jacobi's triple product, build on Euler's pentagonal-number theorem.
Geometric counting. Pentagonal numbers count dots in nested-pentagon patterns; the dual of triangular and square configurations.
Lattice problems. Some 2D lattice-counting problems on pentagonal regions or 5-fold-symmetric structures involve pentagonal-number boundaries.
Recreational mathematics. Pentagonal numbers appear in puzzles, sequences, and figurate-number problems where one extends the polygon-counting paradigm beyond triangles and squares.

Common Mistakes

Confusing pentagonal with pentagon-related counts. Pentagonal numbers count dots in a specific nested-pentagon pattern, not all pentagonal arrangements. The number of dots in a regular pentagon's lattice differs depending on the construction.

Forgetting the divisibility check. 24m+124m + 1 being a perfect square is necessary but not sufficient. The divisibility-by-6 condition on 1+24m+11 + \sqrt{24m + 1} filters out spurious candidates. Example: if 24m+1=49=7224m + 1 = 49 = 7^2, then 1+7=81 + 7 = 8, not divisible by 6 — so m=2m = 2 is not pentagonal even though the perfect-square check passes.

Confusing with generalized pentagonal numbers. The "classical" pentagonal numbers use n1n \geq 1 giving 1, 5, 12, 22, ... The generalized version allows all integer nn giving 0, 1, 2, 5, 7, 12, 15, ... — different sequences with different roles.

Misapplying the closed form. Pn=n(3n1)/2P_n = n(3n - 1)/2 is exact for positive integer nn. Extending to fractional or negative nn requires the generalized formulation.

Confusing $P_n$ with the partition function $p(n)$. Both use the letter pp, but p(n)p(n) counts integer partitions while PnP_n is the nn-th pentagonal number. The two are connected via Euler's theorem but distinct.

Related Sequences and Concepts

Triangular NumbersTn=n(n+1)/2T_n = n(n+1)/2. The first figurate family; pentagonal numbers extend the pattern to 5 sides.

Square NumbersSn=n2S_n = n^2. The second figurate family; sits between triangular and pentagonal.

Hexagonal NumbersHn=n(2n1)H_n = n(2n-1). The next polygonal sequence after pentagonal.

Generalized Pentagonal Numbers — 0, 1, 2, 5, 7, 12, 15, 22, ... — pentagonal-number formula extended to all integer indexes. Appears in Euler's theorem.

Integer Partition — the number of ways to write nn as a sum of positive integers, disregarding order. Pentagonal numbers determine the recurrence for the partition function.

Partition Function $p(n)$ — counts partitions of nn. Euler gave a pentagonal-number recurrence; Hardy and Ramanujan gave an asymptotic; Rademacher gave an exact formula.

Dedekind Eta Function — a modular form whose qq-expansion features pentagonal-number exponents. Foundational in the theory of modular forms.

Polygonal Numbers — the family of rr-gonal numbers for r=3,4,5,6,r = 3, 4, 5, 6, \ldots. Pentagonal is the r=5r = 5 case.

Euler's Pentagonal Number Theorem — the identity (1xn)=(1)kxk(3k1)/2\prod (1 - x^n) = \sum (-1)^k x^{k(3k-1)/2}, summed over all integers kk. One of the most beautiful results in the theory of partitions.

Figurate Numbers — the umbrella term covering all polygonal, pyramidal, and higher-dimensional analogs. Pentagonal is one entry in a vast taxonomy.

Generating Function — the formal power-series tool that connects pentagonal numbers to partitions, modular forms, and combinatorial identities.