Partições de n (p(n), n≤10)
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
partições de inteiro
About this calculator
This calculator lists all partitions of an integer n, for n from 1 to 10. A partition of n is a sum of positive integers that equals n, where the order of the parts does not matter. For example, the partitions of 4 are: 4, 3+1, 2+2, 2+1+1, 1+1+1+1. The tool displays each partition as a unique combination of integers, useful for exploring concepts in combinatorics and number theory.
It works using a recursive algorithm that generates all combinations of positive integers whose sum equals n. The algorithm starts with the largest possible number (n) and then tests all smaller combinations, ensuring no repetitions due to order. The result is a complete and ordered list of partitions, presented in a readable format.
When to use? This calculator is ideal for math students learning about integer partitions, for quickly verifying partitions of small numbers, or for teachers needing didactic examples. It can also be useful in combinatorics problems, such as distributing indistinguishable objects into groups, or in programming exercises involving recursion.
Caveats: The calculator works only for n up to 10, as the number of partitions grows rapidly and listing all for n>10 can be lengthy. Also, remember that partitions consider only the sum, disregarding order. For problems where order matters (like compositions), this tool is not suitable.
Frequently asked questions
What is a partition of an integer?
It is a way of writing the integer as a sum of positive integers, disregarding order. For example, 3 can be 3, 2+1, or 1+1+1.
Why does the calculator only work for n up to 10?
The number of partitions grows exponentially. For n=10 there are 42 partitions; for n=20 there are 627, which would be too long for practical display.
Does the order of the parts matter?
No. Partitions ignore order. 2+1 and 1+2 are considered the same partition. The calculator displays each combination only once.
Can I use this for negative numbers or zero?
No. The calculator is for positive integers from 1 to 10. Zero has one partition (the empty one), but it is not included. Negative numbers are not considered.
What is the difference between a partition and a composition?
In a composition, order matters. For example, 2+1 and 1+2 are different compositions, but they are the same partition. This calculator deals with partitions.