Counting & Number Theory
Integer Partitions with Part Restrictions Calculator
Count unordered decompositions of an integer into positive parts, with distinct-part and exact-part-count comparisons.
How the calculation works
Unrestricted partition counts use ascending unbounded coin-sum dynamic programming for part sizes 1 through n. Distinct-part counts update sums in descending order. Exact-k positive-part counts satisfy p(n,k)=p(n−1,k−1)+p(n−k,k), with the empty partition base case.
Worked example
Example inputs — Integer to partition n: 5; Exactly this many positive parts k: 2. Expected results — All positive-part partitions: 7; Partitions into distinct positive parts: 3; Partitions into exactly k positive parts: 2.
Assumptions and limits
Exact integer arithmetic is used for counts and integer results. Computation limits keep this browser tool responsive. Specify whether objects/groups are distinguishable and whether order matters; different conventions count different outcomes. Part order is ignored: 2+3 and 3+2 are one partition. Parts are numbers, not groups of labelled objects. For zero total, the empty partition counts once; it has zero parts. Asking for more positive parts than the total returns zero.
Reference and further reading
Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.
Related calculators
- Modular Power, Inverse & Bezout Calculator
- Chinese Remainder & Compatible Congruences Calculator
- Prime Factorization, Divisors & Totient Calculator
- Exact Integer Base 2–36 Converter
- Decimal to Best Bounded-Denominator Fraction Calculator
Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.