ROSECODE 115
Pure partitions
Author Philippe_57721
A partition of n is pure if it can express every number between 1 and n in exactly one way.
There are 8 pure partitions of 11:
- 6 3 1 1 = 1 (1+1) 3 (3+1) (3+1+1) 6 (6+1) (6+1+1) (6+3) (6+3+1) (6+3+1+1+1)
- 6 2 2 1 = 1 2 (2+1) (2+2) (2+2+1) 6 (6+1) (6+2) (6+2+1) (6+2+2) (6+2+2+1)
- 6 1 1 1 1 1 = 1 (1+1) (1+1+1) (1+1+1+1) (1+1+1+1+1+1) 6 (6+1) (6+1+1) (6+1+1+1) (6+1+1+1+1) (6+1+1+1+1+1+1)
- 4 4 2 1 = 1 2 (2+1) 4 (4+1) (4+2) (4+2+1) (4+4) (4+4+1) (4+4+2) (4+4+2+1)
- 4 4 1 1 1 = 1 (1+1) (1+1+1) 4 (4+1) (4+1+1) (4+1+1+1) (4+4) (4+4+1) (4+4+1+1) (4+4+1+1+1)
- 3 3 3 1 1 = 1 (1+1) 3 (3+1) (3+1+1) (3+3) (3+3+1) (3+3+1+1) (3+3+3) (3+3+3+1) (3+3+3+1+1)
- 2 2 2 2 2 1 = 1 2 (2+1) (2+2) (2+2+1) (2+2+2) (2+2+2+1) (2+2+2+2) (2+2+2+2+1) (2+2+2+2+2) (2+2+2+2+2+1)
- 1 1 1 1 1 1 1 1 1 1 1 = 1 (1+1) (1+1+1) (1+1+1+1) (1+1+1+1+1) (1+1+1+1+1+1) (1+1+1+1+1+1+1) (1+1+1+1+1+1+1+1) (1+1+1+1+1+1+1+1+1+) (1+1+1+1+1+1+1+1+1+1)(1+1+1+1+1+1+1+1+1+1+1)
[My timing: < 100ms]