Calculators
Fixed-Part Integer Partition Calculator
Count exact unordered partitions of a total into exactly k positive parts, with repeats allowed, privately in your browser.
Count unordered sums of exactly k positive integers. Repeated parts are allowed. Enter a total and part count from 0 to 1000. Zero has one empty partition with zero parts. Results stay in your browser.
Partition a total into exactly k positive parts
An integer partition into exactly k positive parts writes n as an unordered sum of k positive integers. Repeated values are allowed. For n = 7 and k = 3, the four partitions are 5 + 1 + 1, 4 + 2 + 1, 3 + 3 + 1 and 3 + 2 + 2. Reordering parts does not create a new partition. Subtracting one from every part gives a partition of n − k into at most k parts; conjugating its Ferrers diagram gives a partition whose largest part is at most k. Dynamic programming therefore counts sums of n − k using allowed values 1 through k, with ascending updates D(s) = D(s) + D(s − j) for each allowed value j. BigInt arithmetic preserves all digits. There is one empty partition when n = k = 0; other zero-part cases and k > n give zero. Inputs accept whole numbers from 0 to 1000 using one to four digits, including leading zeros and surrounding whitespace. Signs, decimals and scientific notation are rejected. This differs from compositions, where order matters, and Stirling numbers, which partition distinct objects into groups. Inputs are never uploaded or stored.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
Does order matter, and can parts repeat?
Order does not matter and repeated positive parts are allowed. For 7 and 3 parts the count is four: 5+1+1, 4+2+1, 3+3+1 and 3+2+2.
What happens for zero or too many parts?
Zero has one empty partition with zero parts. A positive total with zero parts, zero with positive parts, or more parts than the total gives zero.
How are exact counts calculated?
Subtract one from each positive part and count partitions of n − k with largest part at most k using dynamic programming and exact BigInt arithmetic. Both inputs support 0 to 1000. Calculations stay in your browser.