Skip to main content
3 of 3
links
Martin Sleziak
  • 4.7k
  • 4
  • 35
  • 40

What you want is known as a Gray code for integer partitions.

It exists.

See C. D. Savage, Gray code sequences of partitions, Journal of Algorithms 10 (1989) 577-595. Disclaimer: I haven't actually read this paper. Other sources such as this 1997 survey by Savage and these class notes don't say what the construction is but say that it's complicated.

Michael Lugo
  • 14k
  • 7
  • 58
  • 80