Partition Number Calculator

Explore partitions through exact, distinct, bounded modes. View recurrence details, example tables, and instant summaries. Download polished outputs and verify counts with confidence today.

Calculator Inputs

Reset

This calculator keeps exact integer results reliable for target values from 0 to 300.

Example Data Table

n Conditions Partition count Sample interpretation
5 Unrestricted 7 All unordered sums of 5 are counted.
6 Exactly 2 parts 3 5+1, 4+2, and 3+3.
8 Distinct parts only 6 No part value can repeat.
7 Odd parts only 5 Matches the distinct-part count by Euler’s theorem.
9 Maximum part = 3 12 Every part must be 1, 2, or 3.

Formula Used

1) Unrestricted partition function

The classic partition number p(n) counts unordered decompositions of n into positive integers. Its generating function is 1 / Π(1 − xk) for k ≥ 1.

2) Euler pentagonal recurrence

For unrestricted counts, p(0) = 1 and p(n) uses alternating signs over generalized pentagonal offsets gk = k(3k − 1) / 2.

3) Dynamic programming update

This page computes exact totals with dp[s] += dp[s − part]. For exactly k parts, it uses dp[s][c] += dp[s − part][c − 1].

4) Distinct and odd restrictions

Distinct parts are enforced by looping sums downward. Odd-only cases filter allowed parts to odd integers. Euler’s theorem states odd-part partitions equal distinct-part partitions for unrestricted size limits.

How to Use This Calculator

  1. Enter the target integer n you want to partition.
  2. Set the smallest and largest allowed part values.
  3. Leave exact parts blank for unrestricted length, or enter a fixed count.
  4. Switch on distinct-only or odd-only rules when needed.
  5. Press the calculate button to display the result above the form.
  6. Review the summary table, comparison metrics, and unrestricted benchmark.
  7. Export the visible result as CSV or PDF for records or class notes.

Frequently Asked Questions

What is a partition number?

A partition number counts how many unordered ways an integer can be written as a sum of positive integers. Order never creates a new partition.

Does 3 + 2 differ from 2 + 3?

No. Integer partitions ignore order, so both sums describe the same partition. This is different from compositions, where order matters.

What does exact number of parts mean?

It forces each valid partition to contain a fixed count of terms. For example, partitioning 6 into exactly 2 parts gives 5+1, 4+2, and 3+3.

Why do odd-only and distinct-only counts sometimes match?

Euler proved a famous identity: partitions into odd parts equal partitions into distinct parts, provided no extra bounds alter the unrestricted setting.

What does the maximum part limit do?

It removes any partition containing a value larger than the chosen ceiling. This is useful for bounded-summand questions and constrained counting exercises.

Why can the result be zero?

Some constraints are impossible together. For example, requiring too many large distinct parts or setting minimum values beyond the target can eliminate every partition.

How large can n be here?

This implementation keeps exact results dependable for values from 0 to 300. Larger unrestricted counts grow rapidly and can exceed standard integer limits.

Can I download the output?

Yes. After calculating, use the CSV button for spreadsheet-ready data or the PDF button for a neat summary you can save or share.

Related Calculators

probability combination calculatorbinomial coefficient calculatorpermutation with repetition calculatordouble factorial calculatoranagram calculatorstirling number calculatorsubset sum calculatorpermutation formula calculatorballs and urns calculatorcombinatorial probability calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.