Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Check whether the argument is a weakly decreasing list of positive integers
|
ResourceFunction["IntegerPartitionQ"][x] checks whether x is a weakly decreasing list of positive integers. |
Here are the 5 integer partitions of 4:
| In[1]:= |
|
| Out[1]= |
|
They all pass the test for being an integer partition:
| In[2]:= |
|
| Out[2]= |
|
The parts all have to be integers:
| In[3]:= |
|
| Out[3]= |
|
The parts have to be positive:
| In[4]:= |
|
| Out[4]= |
|
The parts have to be in weakly decreasing order:
| In[5]:= |
|
| Out[5]= |
|
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License