Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Pentagonal Numbers Calculator

How to use Pentagonal Numbers Calculator
  1. Pick a mode with the four tabs across the top of the card: List first N, List a – b, Test a number or Lookup by index; the ? beside each tab describes it. Learn more about the modes
  2. In List first N, type how many terms to show in Show first and click Update; the cards give the count, the largest term and the sum, and the tiles list every term. Learn more about listing terms
  3. In List a – b, type the From index and the To index and click List range; a red box explains a bad range. Learn more about ranges
  4. In Test a number, type a positive integer in Test number and click Check; a green box names the index, a red box says it is not a pentagonal number. Learn more about the test
  5. In Lookup by index, type the position in Index n and click Get term. Learn more about lookups
  6. The panel on the right explains the current mode and walks through the arithmetic with your own numbers; it changes with every tab and click. Learn more about the panel





Listing the First N Terms

DemoTen terms, thirty terms, the cap, one term
Step 0 of 4
The explorer opens on the List first N tab, one of four tabs across the top of the card; the small ? beside each tab shows what the mode does. Type how many terms you want in the Show first box and click Update or press Enter. Three cards answer at once: Showing gives the count, Largest the last term with its index, and Sum the total of the listed terms, which for pentagonal numbers is N2(N+1)/2N^2(N+1)/2. Under the cards every term is laid out as a tile with its index above its value, so P1=1P_1 = 1 to PNP_N can be read in order.

The box accepts 11 to 200200: 1010 gives P10=145P_{10} = 145 with the sum 550550, 3030 gives P30=1,335P_{30} = 1,335 with the sum 13,95013,950, and 300300 is capped at 200200 terms, ending at P200=59,900P_{200} = 59,900 with the sum 4,020,0004,020,000; a single term gives P1=1P_1 = 1. Large values are printed with thousands separators. A count of 0, a decimal or an empty box is refused with "Enter a positive integer." There is no Reset button: type a new count and click Update again. The panel on the right, List first N, states the rule the tiles come from, and its walkthrough repeats the last term and the sum with your own NN. What the terms are is explained in what is a pentagonal number.

Listing a Range of Indexes

DemoThe range tab, a new range, two bad ranges
Step 0 of 4
Click the List a – b tab to list the terms between two positions instead of starting from 11. Type the From index and the To index and click List range or press Enter. The cards give the Count b−a+1b - a + 1, the Smallest term PaP_a and the Largest term PbP_b, and the tiles below list every term in between with its index. The tab opens with 55 to 1515, 11 terms from P5=35P_{5} = 35 to P15=330P_{15} = 330; indexes 1010 to 2020 give 11 terms from 145145 to 590590.

Both boxes must hold positive integers, the first no larger than the second, and the range may hold at most 200200 terms; otherwise a red box explains: "Enter two positive integer indexes", "From-index must be less than or equal to to-index", or "Range too wide — cap is 200 terms". The panel on the right, List a – b, explains the mode, and its walkthrough names the smallest and largest term of your range. The rule each tile uses is explained in the closed form derivation.

Testing a Number

DemoThe test tab, a non-member, a member, 0
Step 0 of 4
Click the Test a number tab to ask whether a given positive integer is a pentagonal number. Type it in the Test number box and click Check or press Enter. A green box with a tick answers yes and names the index, as for the opening value 117117, which is P9P_{9}; a red box with a cross answers no, as for 100100, and the walkthrough on the right then shows the two nearest pentagonal numbers, P8=92P_{8} = 92 and P9=117P_{9} = 117. A large value is handled the same way: 10,04510,045 is P82P_{82}.

The box takes positive integers only; 00, a negative number or a decimal is refused with "Enter a positive integer". The test behind the answer is exact: the explorer checks whether 24m+124m + 1 is a perfect square whose root is 55 more than a multiple of 66; if it is, the index is (24m+1+1)/6(\sqrt{24m + 1} + 1)/6, otherwise the two nearest pentagonal numbers are shown, so no list has to be searched. The panel on the right, Test a number, states this rule, and its walkthrough carries out the arithmetic for your number. The rule itself is explained in the membership test.

Looking Up a Term by Index

DemoThe lookup tab, two indexes, n = 0
Step 0 of 4
Click the Lookup by index tab to compute one term directly. Type the position in the Index n box and click Get term or press Enter. Two cards answer: Index repeats nn and Value gives PnP_n with its index as a subscript. The tab opens with n=25n = 25, which gives P25=925P_{25} = 925; n=100n = 100 gives 14,95014,950 and n=1000n = 1000 gives 1,499,5001,499,500. The box takes positive integers only; 00 is refused with "Enter a positive integer index".

The panel on the right has two parts in every mode. How it works names the rule the mode uses, here Pn=n(3n−1)/2P_n = n(3n-1)/2, and links to the section of this page that explains it; Walkthrough applies the rule to the numbers you typed, so for the lookup it shows the arithmetic with your nn filled in. Both change as soon as you switch tabs or click a button. The rule and where it comes from are in the closed form derivation.

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(3n−1)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[(r−2)n−(r−4)]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+⋯+(3n−2)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.

Figurate numbers are introduced through their simplest case in triangular numbers; the general idea of an explicit formula is explicit and recursive definitions.

The same pairing argument for the triangular case is written out in derivation of the closed form.

The square-root test it generalises is the one for triangular numbers in properties.

The triangular identities these build on are in properties.

The sequences the theorem relates are introduced in definition and notation and triangular numbers.

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 3k−23k - 2 for k=1,2,…,nk = 1, 2, \ldots, n. The sum is

Pn=∑k=1n(3k−2)=3∑k=1nk−2n=3⋅n(n+1)2−2nP_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+3n−4n2=3n2−n2=n(3n−1)2P_n = \frac{3n^2 + 3n - 4n}{2} = \frac{3n^2 - n}{2} = \frac{n(3n - 1)}{2}


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

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


gives Pn(5)=n(3n−1)/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 3n−13n - 1 is even (since 3n3n has the same parity as nn). So n(3n−1)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(3n−1)/2=mP_n = n(3n - 1)/2 = m, the quadratic 3n2−n−2m=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 24⋅117+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: 9⋅26/2=1179 \cdot 26 / 2 = 117. Confirmed.

Non-example. Is 50 pentagonal? Compute 24⋅50+1=120124 \cdot 50 + 1 = 1201. Then 1201≈34.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=Pn−1+(3n−2)P_n = P_{n-1} + (3n - 2) with P1=1P_1 = 1. Each pentagonal number adds the next arithmetic-series term.
• Generating function: ∑n=0∞Pnxn=x(1+x)(1−x)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=T3n−1−Tn−1P_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=T2n−1H_n = T_{2n-1} for triangulars.
• Asymptotic growth: Pn∼3n22P_n \sim \frac{3n^2}{2} as n→∞n \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∞(1−xn)=∑k=−∞∞(−1)kxk(3k−1)/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(3k−1)/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/∏(1−xn)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(n−1)+p(n−2)−p(n−5)−p(n−7)+p(n−12)+p(n−15)−⋯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 ∏(1−xn)=η(τ)/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.

The counting ideas behind these uses start from properties.

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 n≥1n \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(3n−1)/2P_n = n(3n - 1)/2 is exact for positive integer nn. Extending to fractional or negative nn requires the generalized formulation.

• Confusing PnP_n with the partition function p(n)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.

Index conventions and the two ways of defining a sequence are explained in definition and notation and explicit and recursive definitions.