ROSECODE 503
Find the partition
A partition of an integer will be represented by a non increasing sequence of integers.
The partitions of 7 in lexicographic order are:
What are the partition of 123 in lexicographic and anti-lexicographic order?
Answer format: (Comma delimited values) / (Comma delimited values)
Example: 4,2,1/3,2,1,1
[My timing: 11 sec ]
The partitions of 7 in lexicographic order are:
- 1 - 1 1 1 1 1 1 1
- 2 - 2 1 1 1 1 1
- 3 - 2 2 1 1 1
- 4 - 2 2 2 1
- 5 - 3 1 1 1 1
- 6 - 3 2 1 1
- 7 - 3 2 2
- 8 - 3 3 1
- 9 - 4 1 1 1
- 10 - 4 2 1
- 11 - 4 3
- 12 - 5 1 1
- 13 - 5 2
- 14 - 6 1
- 15 - 7
- 1 - 7
- 2 - 6 1
- 3 - 5 2
- 4 - 5 1 1
- 5 - 4 3
- 6 - 4 2 1
- 7 - 4 1 1 1
- 8 - 3 3 1
- 9 - 3 2 2
- 10 - 3 2 1 1
- 11 - 3 1 1 1 1
- 12 - 2 2 2 1
- 13 - 2 2 1 1 1
- 14 - 2 1 1 1 1 1
- 15 - 1 1 1 1 1 1 1
What are the
Answer format: (Comma delimited values) / (Comma delimited values)
Example: 4,2,1/3,2,1,1
[My timing: 11 sec ]