Wave-particle duality and electron energy levels