integer_partitions function
All the ways to write a whole number as a sum of positive whole numbers.
How to write it
integer_partitions(n)
- n
- A whole number. Takes a whole number.
Examples
integer_partitions(4)In the solver,
Open in the solverinteger_partitions(4)gives[[4], [3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]].
Related functions
- integer_exponent
The exponent of a prime in a whole number.
- factor_integer
Prime factorization of a whole number, as a list of prime and exponent pairs.
- partitions_p
How many ways a whole number is a sum of positive whole numbers, in any order of terms.
- partitions_q
How many ways a whole number is a sum of distinct positive whole numbers.
- is_coprime
Test whether two whole numbers have no common divisor above 1.
- is_prime
Test whether a whole number is prime.