Partition Function Calculator

p(n) integer partitions

CalculatorsFreeNo Signup
4.6(871 reviews)
All Tools

Loading tool...

About Partition Function Calculator

An integer partition function calculator computing p(n) = number of ways to write n as sum of positive integers. Shows partition list, generating function, and Ramanujan congruences. Uses dynamic programming. All calculations are client-side.

Partition Function Calculator Features

  • p(n)
  • Partition list
  • Generating function
  • Congruences
  • Table
Partition function p(n): ways to write n as sum of positive integers (order doesn't matter). p(4)=5: 4, 3+1, 2+2, 2+1+1, 1+1+1+1. Generating function: Π1/(1−xᵏ). Ramanujan: p(5n+4)≡0(mod 5), p(7n+5)≡0(mod 7), p(11n+6)≡0(mod 11).

How to Use

Enter n:

  • n: Positive integer
  • p(n): Number of partitions
  • List: All partitions

Properties

  • p(n) ~ exp(π√(2n/3))/(4n√3) (Hardy-Ramanujan)
  • Euler's pentagonal theorem gives recurrence
  • Conjugate partitions: transpose Ferrers diagram

Ramanujan Congruences

p(5n+4)≡0(mod 5). p(7n+5)≡0(mod 7). p(11n+6)≡0(mod 11). Example: p(4)=5, p(9)=30, p(14)=135 — all divisible by 5.

Step-by-Step Instructions

  1. 1Enter n.
  2. 2Get p(n).
  3. 3List partitions.
  4. 4Check congruences.
  5. 5View table.

Partition Function Calculator — Frequently Asked Questions

How fast does p(n) grow?+

Exponentially! Hardy-Ramanujan formula: p(n) ~ exp(π√(2n/3))/(4n√3). p(100)=190,569,292,356. p(200)≈4×10¹². Growth is sub-exponential (slower than 2ⁿ) but still very fast.

How is p(n) computed?+

Dynamic programming: p(n) = Σ p(n−k) over generalized pentagonal numbers k = j(3j±1)/2, with signs (−1)ʲ⁺¹. This is Euler's recurrence from the pentagonal number theorem. O(n√n) time.

What are restricted partitions?+

p(n,k) = partitions of n into exactly k parts. p_distinct(n) = partitions into distinct parts = partitions into odd parts (Euler's theorem). p_odd(n) = partitions into odd parts. These are related by beautiful combinatorial bijections.

Share this tool: