It seemed to me that each wavelength can be represented by a node. Also, it will form a directed acyclic graph. I was thinking of a graph algo but couldn’t come with one. Any ideas anyone?

Also, this question can also be solved using combinatorics, right?

[1]: http://www.quora.com/In-an-hydrogen-atom-there-is-an-electron-in-nth-excited-state-It-then-jumps-to-the-ground-state-with-different-paths-How-many-minimum-number-of-atoms-of-hydrogen-are-required-so-that-we-notice-all-the-wavelengths