OFFSET
1,5
COMMENTS
List the partitions of n and form a graph where two partitions are connected if one can be transformed into the other by adding 1 from one element, subtracting 1 from another element and rearranging (if necessary). A Gray code corresponds to a Hamiltonian path through all of the partitions.
Terms a(6) through a(10) are given in the Knuth reference.
REFERENCES
D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, (to appear), section 7.2.1.4.
EXAMPLE
The partitions of the integer 6 are 111111, 21111, 3111, 2211, 222, 321, 33, 42, 411, 51, 6. Each term is obtained from the previous term by adding 1 to one element, subtracting 1 from another element and rearranging. This is the only way to do it for 6, so a(6)=1.
CROSSREFS
KEYWORD
hard,nonn
AUTHOR
Jud McCranie, Jul 18 2004
STATUS
approved