Complete Technical Guide to Partition a Number
An integer partition of a positive integer n writes n as a sum of positive integers where order does not matter: for example, 4 has p(4) = 5 partitions (4, 3+1, 2+2, 2+1+1, 1+1+1+1). Computing p(n) quickly for large n uses Leonhard Euler's Pentagonal Number Theorem.
This tool computes exact BigInt values of both p(n) (all partitions) and q(n) (distinct-part partitions) up to n = 1,000, while also enumerating individual additive sums for All, Distinct, and Odd-part partitions.
Euler's Pentagonal Number Recurrence
p(n) = p(n-1) + p(n-2) - p(n-5) - p(n-7) + p(n-12) + p(n-15) - ... Generalized pentagonal numbers: g(k) = k(3k ± 1) / 2 Euler's Partition Theorem: # of partitions into DISTINCT parts === # into ODD parts
Watch how Distinct Parts Only and Odd Parts Only ALWAYS display the exact same partition count for every single n!
How to Use Partition a Number
- 1Enter any integer n from 1 to 1,000 (or click n=6, 10, 20, 100).
- 2Switch between All Partitions, Distinct Parts Only, and Odd Parts Only.
- 3Copy or download the enumerated sums.
Reference Examples & Worked Benchmarks
| n | p(n) All | q(n) Distinct = Odd |
|---|---|---|
| 5 | 7 | 3 |
| 10 | 42 | 10 |
| 20 | 627 | 64 |
| 100 | 190,569,292 | 444,793 |
Practical Applications & Engineering Workflows
Combinatorics & Representation Theory
Partition counts p(n) equal the exact number of irreducible representations of the symmetric group S_n.
Ramanujan Congruences
Verify p(5k+4) ≡ 0 (mod 5), e.g., p(4)=5, p(9)=30, p(14)=135.
Accuracy, Edge Cases & Best Practices
- p(1000) is a 32-digit exact integer (24,061,467,864,032,622,473,692,149,727,991) computed in milliseconds!
All calculations execute locally inside your browser using JavaScript with zero server round-trips, guaranteeing instant responsiveness and complete data privacy.