How to use the integer partition calculator
- Enter the number to split, from 1 to 1,000.
- Choose the kind of parts: any, all different, odd only, at most k parts, or exactly k parts. Enter k when it is asked for.
- Read the count, which is exact however large, and the table of partitions when the number is 60 or less and the box is ticked.
- Compare with the counts for distinct and odd parts, which Euler proved are always equal.
Formula
p(n) = number of ways to write n as a sum of positive whole numbers, order ignored
Count with allowed part sizes s: ways(t) <- ways(t) + ways(t - s), one size at a time
Distinct parts: each size is used at most once (a 0/1 version of the same step)
Exactly k parts: p(n - k) with every part at most k
At most k parts = every part at most k (turn the picture on its side)
The counts come from adding up the number of ways for each total, so no partition is generated unless the list is shown. Euler's theorem says partitions into distinct parts and into odd parts are equally many.
Splitting 10, 30 and 100
The number 10 has p(10) = 42 partitions, from 10 and 9 + 1 down to ten ones. Of these, 10 use distinct parts and 10 use only odd parts, as Euler's theorem requires.
For 30, there are 297 partitions into at most 4 parts and 377 into exactly 5 parts. The number 100 has p(100) = 190,569,292 partitions, and 444,793 of them use distinct parts, the same as the number that use odd parts.
What a partition is
A partition of n is a way to write n as a sum of positive whole numbers where the order does not matter, so 3 + 1 and 1 + 3 are the same partition. Partitions appear when you split coins into piles, share identical items among people without caring who gets which, or study how heat energy divides among particles.
The counts grow fast. p(10) is 42, p(100) is 190,569,292 and p(200) is 3,972,999,029,388. There is no simple closed formula, so the page counts by adding up smaller cases, which is exact and quick.
Variations and relatives
Restricting the parts gives many classical results. Partitions into at most k parts correspond one to one with partitions whose largest part is at most k, by reading the diagram of dots by columns instead of rows. This is the conjugate partition idea.
Counting arrangements where order does matter leads to compositions and to the combinations and permutations calculator. For splitting a set of different items into groups, use the Stirling and Bell numbers, and for making change with fixed coin sizes see the Pascal triangle generator as a neighboring counting tool.
Assumptions and limits
- Parts are positive whole numbers; zero is not a part.
- The order of parts does not matter, and each partition is listed once with its parts from largest to smallest.
- The number to split is at most 1,000. Lists are shown only up to 60 and are cut at 100 partitions.
- Counts are exact whole numbers, shown with digit grouping.
Frequently asked questions
What is the difference between a partition and a composition?
In a composition the order counts, so 3 + 1 and 1 + 3 are different. A number n has 2^(n - 1) compositions, which is far more than the number of partitions for large n.
Why are the counts for distinct parts and odd parts equal?
Euler gave a one-to-one matching. Take any partition into odd parts, join equal parts together by doubling, and repeat until all the parts are different. The process can be reversed, so the two collections have the same size.
Can I get partitions with parts from a custom list?
Not on this page. It handles the common restrictions: any, distinct, odd, a limit on the number of parts. Making change from a custom set of coin sizes is a similar count with a fixed list of allowed sizes.
Why is the list limited?
The number of partitions is large even for modest n, and a page with thousands of rows is hard to read. The count is always exact, and the list shows the first 100 in order from the largest first part.