Function Repository Resource:

# IntegerPartitionQ

Check whether the argument is a weakly decreasing list of positive integers

Contributed by: Wolfram Staff
 ResourceFunction["IntegerPartitionQ"][x] checks whether x is a weakly decreasing list of positive integers. ResourceFunction["IntegerPartitionQ"][x,n] checks whether x is an integer partition of n.

## Details

An integer partition is a multiset of positive integers and so not ordered. Therefore, any order can be used to represent it. Typically, the order chosen is weakly decreasing, as here; some people choose weakly increasing.

## Examples

### Basic Examples (2)

Check an integer partition:

 In[1]:=
 Out[1]=

Check whether it is an integer partition of 6:

 In[2]:=
 Out[2]=

Here are the 5 integer partitions of 4:

 In[3]:=
 Out[3]=

They all pass the test for being an integer partition:

 In[4]:=
 Out[4]=

### Properties and Relations (3)

The parts all have to be integers:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

The parts have to be positive:

 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=

The parts have to be in weakly decreasing order:

 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=

George Beck

## Requirements

Wolfram Language 11.3 (March 2018) or above

## Version History

• 1.0.1 – 31 January 2022
• 1.0.0 – 19 April 2019