Documentation Center

  • Trial Software
  • Product Updates

combinat::partitions

Partitions of an integer

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

combinat::partitions(n)

Description

cominat::partitions(n) returns the number of partitions of the integer n.

A partition of a nonnegative integer n is a non-increasing list of positive integers with total sum n.

Examples

Example 1

There are 5 partitions of 4:

combinat::partitions(4)

Parameters

n

Nonnegative integer

Algorithms

Counting is done efficiently with Euler's pentagonal formula for small values of n and Hardy-Ramanujan-Rademacher's formula otherwise.

Was this topic helpful?