This Demonstration shows the quantum-mechanical energy spectrum of an electron in a two-dimensional periodic potential with a perpendicular magnetic field. The fractal nature of this system was discovered by Douglas Hofstadter in 1976.
The Schrödinger equation for this system takes the form
is a pseudodifferential operator,
is the potential, and
is the energy eigenvalue, with
given by the ansatz
The problem reduces to the solution of the recursive equation
is the energy,
being the denominator of nonrepeating rational numbers
. Finally, the eigenvalue condition for the energy spectrum is
The plot has energy on the
axis and the parameter
 D. Hofstadter, "Energy Levels and Wave Functions of Bloch Electrons in Rational and Irrational Magnetic Fields,"
Physical Review B
, 1976 pp. 2239–2249. doi: