Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

combinat::partitions

Partitions of an integer

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

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?