integer_partitions(​n,count)

Computes all partitions of a given nonnegative integer n.
215 Downloads
Updated 8 Jun 2015

View License

A partition of a positive integer n, also called an integer partition, is a way of writing n as a sum of positive integers. Two sums that differ only in the order of their summands are considered the same partition (could be seen as a permutation of the partition). This function computes all partitions of a given nonnegative integer "n", restricted to "count" nonnegative integer summands.

Cite As

Igor Peretta (2024). integer_partitions(n,count) (https://www.mathworks.com/matlabcentral/fileexchange/51123-integer_partitions-n-count), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0