Integer Partitions Calculator
Enter a number to count its integer partitions.
Result
How it is calculated
The tool counts partitions p(n): ways to write n as a sum of positive integers, ignoring order, so 3+1 and 1+3 are the same. It builds a table with the coin-change recurrence: start with p(0) = 1, then for each part size k = 1, 2, …, n update p(j) = p(j) + p(j − k) for j from k up to n. After all part sizes are used, p(n) is the answer. Input is rounded to the nearest whole number, and only 0 to 250 is accepted; anything above gives no result. p(0) = 1 by convention. Counts grow fast, p(100) = 190,569,292, and p(250) = 230,793,554,364,681 is still shown exactly. It counts partitions, not lists them.
Worked example
Take n = 6. Allowing parts of size 1, 2, …, 6 step by step, the table ends with p(6) = 11. Listing them confirms it: 6; 5+1; 4+2; 4+1+1; 3+3; 3+2+1; 3+1+1+1; 2+2+2; 2+2+1+1; 2+1+1+1+1; 1+1+1+1+1+1. That is 11 distinct sums. For comparison p(10) = 42, so the count roughly quadruples while n goes from 6 to 10.
Common mistakes
- Counting orderings as different partitions. 4+1+1, 1+4+1 and 1+1+4 are a single partition; counting ordered sums gives compositions, which are far more numerous (2n−1).
- Forgetting the single-part partition. The number n itself counts as one partition (6 alone).
- Entering a decimal and expecting it to be rejected. The value is rounded, so 7.6 is treated as 8.
- Entering n above 250. The tool gives no result there, not an approximation.
- Confusing partitions into distinct parts or into exactly k parts with p(n). This tool counts all partitions with no restriction.
About this calculator
A partition of a positive integer n is a way of writing it as a sum of positive integers where order doesn't matter — for example, 4 can be partitioned as 4, 3+1, 2+2, 2+1+1, or 1+1+1+1, giving p(4) = 5. This calculator computes p(n) with a dynamic-programming recurrence that counts all such distinct sums, for any n from 0 to 250.
Mathematicians and combinatorics students use partition counts as a foundational topic in number theory, and the underlying recurrence appears in computer science too — competitive programmers implement partition-counting algorithms for problems involving coin-change combinations, generating functions, and other combinatorial counting tasks.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The count p(n) treats 3+1 and 1+3 as the same partition, so it measures ways to split n identical items into piles, not ordered sums. It grows fast: p(10) is 42 while p(100) is 190,569,292. Inputs run from 0 to 250 and decimals are rounded to the nearest whole number. What problem led you to partitions?