Recall that for any rational \(\tau =q/p\) , we have \(q\)  bands and maximally \(q-1\)  gaps in the spectrum, cf. discussion on approximants above and Fig. REF (b). Due to the symmetry properties of the magnetic translation group, there is an interesting connection between number theory and the Chern number \(\nu _r\) 
associated with a gap number \(r=1,\ldots ,(q-1)\) , namely it satisfies the Diophantine equation \(r = \nu _r p + t_r q\) , where \(\nu _r\)  and \(t_r\) 
are integers [1]}, [2]}, [3]}, [4]}. This condition has infinitely many possible solutions, as \(\nu _r\)  is only well defined modulo \(q\) . For specific models, the Chern numbers are constrained to provide a single solution for the Diophantine equation, e.g., for the Hofstadter model, where \(0 < |\nu _r| < q/2\)  [1]}. For other models, finding the correct Chern numbers requires evaluation of Eq. (REF ) and is called “coloring Hofstadter butterflies” due to the association of a color to each value of the Chern number in a spectral gap [6]}, [7]}. Crucial for our discussion, we note also that we can divide the Diophantine equation by \(q\)  to obtain \(\rho _r = \nu _r/\tau + t_r\) , which defines the Chern number for any particle density (filling factor) \(\rho _r\)  within a spectral gap. The latter result does not rely on approximants, it can be applied also for quasiperiodic models, and is sometimes referred to as Streda’s formula [2]}, [9]}. Note that the filling factor (a.k.a. integrated density of state) \(\rho \)  is fixed for quasiperiodic models in each gap by the above condition, i.e., it cannot change without a change in \(\tau \) .
