Quantum mechanics
So we can make a grid like this, where f(a←b) means the frequency involved when an electron goes from energy state (orbit) b to energy state a (Again, sequences look backwards, but that is the way they were originally written.):