  Non-relativistic field theories with anisotropic scale invariance in (1+1)-d
are typically characterized by a dispersion relation $E\sim k^{z}$ and
dynamical exponent $z>1$. The asymptotic growth of the number of states of
these theories can be described by an extension of Cardy formula that depends
on $z$. We show that this result can be recovered by counting the partitions of
an integer into $z$-th powers, as proposed by Hardy and Ramanujan a century
ago. This gives a novel relationship between the characteristic energy of the
dispersion relation with the cylinder radius and the ground state energy. For
free bosons with Lifshitz scaling, this relationship is shown to be identically
fulfilled by virtue of the reflection property of the Riemann $\zeta$-function.
The quantum Benjamin-Ono$_{2}$ (BO$_{2}$) integrable system, relevant in the
AGT correspondence, is also analyzed. As a holographic realization, we provide
a special set of boundary conditions for which the reduced phase space of
Einstein gravity with a couple of $U(1)$ fields on AdS$_3$ is described by the
BO$_{2}$ equations. This suggests that the phase space can be quantized in
terms of quantum BO$_{2}$ states. Indeed, in the semiclassical limit, the
ground state energy of BO$_{2}$ coincides with the energy of global AdS$_{3}$,
and the Bekenstein-Hawking entropy for BTZ black holes is recovered from the
anisotropic extension of Cardy formula.
