AbsentMaverick
December 19th, 2008, 10:07 PM
I need an algorithm to break up natural numbers into lists of their possible constituents;
I.e, 4 =>
1, 1, 1, 1
1, 1, 2
1, 2, 1
2, 1, 1
2, 2
3, 1
1, 3
4
I.e, 4 =>
1, 1, 1, 1
1, 1, 2
1, 2, 1
2, 1, 1
2, 2
3, 1
1, 3
4