Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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)=[[4],[3,1],[2,2],[2,1,1],[1,1,1,1]]\displaystyle \operatorname{integer\_partitions}(4) = \left[ \left[ 4 \right], \left[ 3, 1 \right], \left[ 2, 2 \right], \left[ 2, 1, 1 \right], \left[ 1, 1, 1, 1 \right] \right]
    integer_partitions(4)

    In the solver, integer_partitions(4) gives [[4], [3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]].

    Open in the solver
  • 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.