  The electronic spectrum of a two-dimensional square lattice in a
perpendicular magnetic field has become known as the Hofstadter butterfly
[Hofstadter, Phys. Rev. B 14, 2239 (1976).]. We have calculated
quasi-one-dimensional analogs of the Hofstadter butterfly for carbon nanotubes
(CNTs). For the case of single-wall CNTs, it is straightforward to implement
magnetic fields parallel to the tube axis by means of zone folding in the
graphene reciprocal lattice. We have also studied perpendicular magnetic fields
which, in contrast to the parallel case, lead to a much richer, pseudofractal
spectrum. Moreover, we have investigated magnetic fields piercing double-wall
CNTs and found strong signatures of interwall interaction in the resulting
Hofstadter butterfly spectrum, which can be understood with the help of a
minimal model. Ubiquitous to all perpendicular magnetic field spectra is the
presence of cusp catastrophes at specific values of energy and magnetic field.
Resolving the density of states along the tube circumference allows recognition
of the snake states already predicted for nonuniform magnetic fields in the
two-dimensional electron gas. An analytic model of the magnetic spectrum of
electrons on a cylindrical surface is used to explain some of the results.
