Pentagonal Number Calculator

P(n) = n(3n−1)/2

CalculatorsFreeNo Signup
4.6(695 reviews)
All Tools

Loading tool...

About Pentagonal Number Calculator

A pentagonal number calculator computing P(n) = n(3n−1)/2 for both positive and generalized (negative) indices. Key in Euler's pentagonal number theorem for partition function recurrences. Tests if a given number is pentagonal. Client-side.

Pentagonal Number Calculator Features

  • P(n) computation
  • Generalized pentagonal
  • Test membership
  • Euler theorem
  • Sequence
Pentagonal numbers: 1, 5, 12, 22, 35, 51, 70... P(n) = n(3n−1)/2. Generalized: P(−n) = n(3n+1)/2 gives 0, 2, 7, 15, 26... Euler's pentagonal theorem: Π(1−x^n) = Σ (−1)^k x^{P(k)} gives a recurrence for the partition function p(n).

How to Use

Enter n or test a value:

  • P(n): nth pentagonal
  • Test: Is N pentagonal?
  • Generalized: Both signs

Euler's Theorem

Π_{n≥1}(1−x^n) = 1 − x − x² + x⁵ + x⁷ − x¹² − x¹⁵ + ... The exponents are generalized pentagonal numbers! This gives the fastest recurrence for computing p(n): p(n) = Σ (−1)^{k+1} p(n−P(k)).

Geometric Meaning

Arrange dots in nested pentagons: 1, 5, 12, 22... Each layer adds a larger pentagon ring. The formula n(3n−1)/2 counts dots. Unlike triangular/square numbers, pentagonal numbers have deep connections to partition theory.

Step-by-Step Instructions

  1. 1Enter n.
  2. 2Compute P(n).
  3. 3Generate sequence.
  4. 4Test membership.
  5. 5See Euler connection.

Pentagonal Number Calculator — Frequently Asked Questions

What are generalized pentagonal numbers?+

Using negative indices: P(0)=0, P(1)=1, P(-1)=2, P(2)=5, P(-2)=7, P(3)=12, P(-3)=15... The sequence 0,1,2,5,7,12,15,22,26,... These appear as exponents in Euler's pentagonal theorem, which is why they matter.

How does the partition recurrence work?+

p(n) = p(n-1) + p(n-2) - p(n-5) - p(n-7) + p(n-12) + p(n-15) - ... The signs follow +,+,-,-,+,+,-,- and the subtracted values are generalized pentagonal numbers. This computes p(n) in O(n√n) time.

Is there a test for pentagonal numbers?+

Yes: N is pentagonal iff (1+√(1+24N))/6 is a positive integer. Equivalently, 24N+1 must be a perfect square ≡1 (mod 6). This gives an O(1) test (up to square root computation).

Share this tool: