Integer Partition Calculator

Partitions p(10)42
Partitions p(9) for comparison30
Partitions into distinct parts10
Growth over p(n - 1)1.40 x
How this was calculated
  1. A partition of 10 is a way of writing it as a sum of positive whole numbers where the order of the parts does not matter. There are exactly 42 of them, counted here with Euler's pentagonal recurrence.
  2. The recurrence builds p(n) from earlier values by subtracting the generalised pentagonal numbers 1, 2, 5, 7, 12, 15, ... with alternating signs in pairs: add, add, subtract, subtract.
  3. Restricting the parts to be all different leaves 10 partitions. Euler proved this always equals the number of partitions of 10 into odd parts, a result that still surprises students meeting it for the first time.
  4. The count grows fast: p(10) is 1.40 times p(9), and by p(200) the total is already in the trillions, which is why exact counting uses integer arithmetic throughout.

This integer partition calculator tells you how many ways a whole number can be written as a sum of positive integers, where order does not matter. For example, there are exactly 42 partitions of 10, and 1,958 partitions of 25. For larger inputs the counts grow fast: p(50) = 204,226, counted exactly with Euler's pentagonal recurrence. The calculator applies that same recurrence and returns the exact partition count for the number you enter, with no rounding or approximation.

Euler's pentagonal recurrence is the accepted standard for exact partition counting because it builds each value from earlier ones using the generalized pentagonal numbers 1, 2, 5, 7, 12, 15, with alternating signs in pairs. This method is exact by construction, and the page uses integer arithmetic throughout, since the counts outgrow floating point quickly: p(50) is 1.18 times p(49) = 173,525, yet by p(200) the count is already in the trillions. The recurrence also makes patterns easy to check; for instance, partitions of 25 into distinct parts number 142, the same as its partitions into odd parts. On this page you will find the formula written out, step-by-step workings, worked examples, and sources for the values shown.

Worked examples

n = 10

(10)

Partitions p(10)42
Partitions p(9) for comparison30
Partitions into distinct parts10
Growth over p(n - 1)1.40 x

n = 25

(25)

Partitions p(25)1,958
Partitions p(24) for comparison1,575
Partitions into distinct parts142
Growth over p(n - 1)1.24 x

n = 50

(50)

Partitions p(50)204,226
Partitions p(49) for comparison173,525
Partitions into distinct parts3,658
Growth over p(n - 1)1.18 x

How integer partitions are counted

An integer partition calculator does not guess or estimate: it builds each count from counts it has already established. The standard method is Euler's pentagonal recurrence, which expresses p(n) — the number of partitions of n — as an alternating sum of earlier values of p. The terms are indexed by the generalized pentagonal numbers 1, 2, 5, 7, 12, 15, and so on, and the signs alternate in pairs: plus, plus, minus, minus, plus, plus, and onward. Each step of the recurrence therefore reaches back only to smaller arguments, so a table can be filled in from p(0) = 1 upward without ever enumerating a single partition.

The recurrence is easiest to trust when it is checked against known values. Take n = 10. Subtracting the pentagonal numbers from 10 gives 9, 8, 5, 3, and −2, and the alternating signs in pairs turn this into p(9) + p(8) − p(5) − p(3). Filling in the earlier values and combining them yields exactly 42, which matches the known count of partitions of 10. The same procedure at n = 25 produces 1,958, again matching the known total. Two independent checks on the same rule, at two different sizes, are what make the recurrence reliable rather than merely plausible.

That reliability matters because the counts climb steeply. p(50) is 204,226, counted exactly with Euler's pentagonal recurrence. The growth is fast but not uniform: p(50) is 1.18 times p(49) = 173,525, yet by p(200) the count is already in the trillions. A method that depended on listing partitions would be hopeless long before that point; a method that depends on earlier counts stays practical, because each new value costs only a short sum of terms.

One detail keeps the arithmetic honest. Exact counting uses integer arithmetic throughout, since the counts outgrow floating point quickly. Ordinary floating-point numbers lose precision once values pass a certain size, and a count that is off by one is simply wrong. Working in integers means every intermediate sum is exact, so the final figure is the true number of partitions and not an approximation of it.

The recurrence also explains a pleasing coincidence. Partitions of 25 into distinct parts number 142, the same as its partitions into odd parts — a correspondence Euler proved, and one that a correct counting tool will reproduce without special handling. Whether you are checking a single value such as p(10) = 42 or generating a long table of counts, the integer partition calculator applies the pentagonal recurrence step by step, in exact integer arithmetic, so each result follows from the ones before it.

Check the rule yourself: the recurrence gives p(10) = 42 and p(25) = 1,958, the same values obtained by counting partitions directly.

Partitions into distinct and odd parts

A partition of an integer is a way of writing it as a sum of positive integers where order does not matter. Within that set, two subfamilies look quite different at first glance: partitions into distinct parts (no value repeated) and partitions into odd parts (every summand odd). Euler's theorem says these two counts are always equal, for every positive integer. The integer partition calculator reflects this: it reports the distinct-part count and the odd-part count as the same number, because the theorem guarantees they cannot differ.

The number 25 makes the identity concrete. There are 1,958 partitions of 25 in total, and exactly 142 of them use distinct parts. The count of partitions of 25 into odd parts is also 142. Nothing about the two lists of partitions is obviously parallel — a distinct-part partition such as 12 + 8 + 5 has no odd entries at all, while an odd-part partition such as 9 + 7 + 5 + 3 + 1 repeats values — yet the totals match exactly. For comparison, 10 has exactly 42 partitions, so the full count grows quickly even at small inputs while the distinct and odd subtotals stay tied together.

The theorem is usually proved with a generating-function or bijection argument, but for calculation you only need the consequence: compute one of the two counts and you have the other. That is useful because both subfamilies are cheaper to enumerate than the full partition set. The full count is the demanding quantity. p(50) = 204,226, counted exactly with Euler's pentagonal recurrence, which uses the generalized pentagonal numbers 1, 2, 5, 7, 12, 15 with alternating signs applied in pairs. The same recurrence extends to any n you enter, and it produces exact values rather than approximations.

Growth is steep but uneven. p(50) is 1.18 times p(49) = 173,525, a modest step, yet by p(200) the count is already in the trillions. Because of that, exact counting uses integer arithmetic throughout, since the counts outgrow floating point quickly — a float would silently lose digits long before the numbers reach their full size. A tool built on the recurrence therefore returns the true integer, not a rounded one.

When you use the calculator, read the distinct and odd figures as a check on each other. If they ever disagreed, something in the computation would be wrong; under Euler's theorem they are two views of one quantity. The total partition count sits alongside them, and the gap between the total and the 142 at n = 25 shows how much of the partition set is built from repeated parts.

Euler's theorem: for every n, the number of partitions into distinct parts equals the number into odd parts. At n = 25 both counts are 142.

How fast p(n) grows

Partition counts do not climb at a steady rate — the ratio between one value and the next keeps shrinking even as the numbers themselves explode. Looking at the early examples makes this visible. There are exactly 42 partitions of 10. Move up to 25 and the count is 1,958 — roughly 1.40 times larger for each step in between, on average. That sounds modest, but it is already compounding fast. An integer partition calculator makes this easy to see because it reports each count exactly rather than rounding it into scientific notation.

The ratio keeps falling as n rises. At 50 the count is 204,226, counted exactly with Euler's pentagonal recurrence, and p(50) is only 1.18 times p(49) = 173,525. So the step from 49 to 50 multiplies the total by just 1.18, compared with the 1.40 average seen across the climb from 10 to 25. A shrinking ratio of this kind is typical: each new value is a smaller multiple of the one before it, yet the totals still grow without any ceiling. The multiplier gets smaller while the number it multiplies gets larger, and the second effect wins.

That is why p(200) already sits in the trillions. A ratio near 1.18 or 1.24 applied again and again, over a hundred or more steps, produces enormous results even though no single step looks dramatic. The growth is steady rather than sudden, which is exactly why it is easy to underestimate. Reading a table of counts from small n upward, the jump from thousands to millions to billions to trillions feels abrupt, but every individual multiplication along the way was small.

This is also why exact counting uses integer arithmetic throughout, since the counts outgrow floating point quickly. Floating point numbers carry a fixed amount of precision, and once the totals pass a certain size they can no longer be represented exactly. A tool built for this job keeps every digit, so the answer for p(50) is 204,226 and not an approximation. The recurrence itself relies on the generalised pentagonal numbers 1, 2, 5, 7, 12, 15, with alternating signs in pairs, which lets the count be built up step by step from smaller values.

The same growth shows up in restricted kinds of partitions. Partitions of 25 into distinct parts number 142, the same as its partitions into odd parts — a matching result that holds in general. Small cases like these are where the structure is easiest to check by hand, and they give a sense of how the counts behave before the totals become too large to inspect.

  • From 10 to 25: about 1.40 times larger per step on average (42 partitions of 10; 1,958 of 25).
  • p(50) is 1.18 times p(49) = 173,525, so the per-step multiplier has shrunk.
  • A ratio near 1.24 applied repeatedly still produces huge totals over many steps.
  • By p(200) the count is already in the trillions, even though each step multiplies by a modest factor.
  • Partitions of 25 into distinct parts number 142, the same as its partitions into odd parts.
A small multiplier repeated many times beats a large one used only a few times — which is why p(200) reaches the trillions while p(50) is still 204,226.

Where partitions appear

Integer partitions turn up in more places than the name suggests. A partition is just a way of writing a whole number as a sum of positive whole numbers, where the order of the terms does not matter. That simple idea sits underneath problems in coin change, additive number theory and statistical mechanics. An integer partition calculator does the bookkeeping for these counts, which grow so fast that manual enumeration stops being practical very early.

The coin-change connection is the most concrete. If you have coins of fixed denominations and want to know how many ways a given total can be made, you are counting partitions restricted to those denominations. The unrestricted case, where any positive whole number counts as a "coin," gives the partition numbers themselves. The counts climb quickly: there are exactly 42 partitions of 10 and 1,958 partitions of 25. A related symmetry appears when you restrict the parts: partitions of 25 into distinct parts number 142, the same as its partitions into odd parts.

In additive number theory, partitions are studied as objects in their own right, and exact values matter for checking conjectures and identities. In statistical mechanics, partition functions count the ways energy can be distributed among the states of a system, a direct analogue of counting sums. For small inputs, listing partitions is fine. For large inputs it is hopeless. p(50) = 204,226, and that value is counted exactly with Euler's pentagonal recurrence rather than by listing every partition. The growth is relentless: p(50) is 1.18 times p(49) = 173,525, yet by p(200) the count is already in the trillions.

This is why generating functions and recurrences replace enumeration. Euler's pentagonal recurrence builds each partition number from earlier ones, subtracting and adding in a fixed pattern. It uses the generalised pentagonal numbers 1, 2, 5, 7, 12, 15 with alternating signs in pairs. Because each step reuses values already computed, the work grows far more slowly than listing partitions one by one. Exact counting uses integer arithmetic throughout, since the counts outgrow floating point quickly; a calculator that switches to ordinary decimals would start returning rounded, unreliable answers long before the numbers get interesting.

The practical lesson is that the right method depends on the size of the question. Small totals can be enumerated by hand or by a short program. Once the counts reach the hundreds of thousands and beyond, a recurrence or generating function is the only sensible route, and exact integer arithmetic is what keeps the answers trustworthy.

Order does not matter in a partition: 3 + 2 and 2 + 3 are the same partition of 5. That is what separates partition counts from compositions.

FAQs

How many partitions does 10 have?

The number 10 has 42 partitions. That is the count of ways to write 10 as a sum of positive integers where order does not matter. For comparison, 9 has 30 partitions. So the count grows quickly as n increases, even between two small consecutive numbers like 9 and 10.

What is p(50)?

p(50) is 204,226 partitions. That is the total number of ways to write 50 as a sum of positive integers, ignoring order. Of those, 3,658 are partitions into distinct parts, meaning no part is repeated. The calculator reports both the full count and the distinct-part count for the number you enter.

What is the pentagonal recurrence?

The pentagonal recurrence builds p(n) from earlier values by subtracting pentagonal numbers 1, 2, 5, 7, 12, 15 and so on. The signs come in pairs: add, add, subtract, subtract. This lets the calculator compute each partition count from values it already has, rather than listing every partition one by one.

Are distinct-part partitions equal to odd-part partitions?

Yes. By Euler's theorem, the number of partitions into distinct parts equals the number of partitions into odd parts. For 25, both counts are 142. So if you count the ways to split a number into parts that are all different, you get the same total as counting the ways to split it into parts that are all odd.

How large can n be?

The calculator counts exactly up to n = 200. At that size the total number of partitions is already in the trillions, so the counts get very large. The limit of 200 keeps the results exact rather than approximate, while still covering inputs far beyond everyday use.

Does the order of parts matter?

No. Order does not matter: 3 + 2 and 2 + 3 are the same partition of 5. This is what makes the count a partition rather than a composition. A composition treats different orderings as different, so it counts more; a partition groups all reorderings of the same parts into a single entry.

Sources

Related calculators

Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.
Permutations Calculator
Permutations P(n, r), combinations C(n, r), permutations with repetition and n factorial, with large results in compact form.
Modulo Calculator
a mod n with the full division equation shown — including the negative-number case, where the mathematical (floor) answer and the JavaScript/C truncated remainder genuinely differ.