Definition: For a given rational number $\delta/\gamma$ with
$\gcd(\delta,\gamma)=1$, the _Ford circle_ $\mathcal{C}(\delta,\gamma)$ is
defined as the circle in the complex upper half plane with radius
$1/(2\gamma^{2})$ that is tangent to the point $\delta/\gamma$.

Two Ford circles $\mathcal{C}(\delta,\gamma)$ and
$\mathcal{C}(\delta^{\prime},\gamma^{\prime})$ are either tangent to each
other or they do not intersect. They are tangent if, and only if,
$\gamma\delta^{\prime}-\gamma^{\prime}\delta=\pm 1$, which is the same as
saying that they are the Ford circles associated to two consecutive Farey
fractions. If $\delta_{1}/\gamma_{1}<\delta/\gamma<\delta_{2}/\gamma_{2}$ are
three consecutive Farey fractions in $\mathcal{F}_{N}$, the points of tangency
of $\mathcal{C}(\delta,\gamma)$ with $\mathcal{C}(\delta_{1},\gamma_{2})$ and
$\mathcal{C}(\delta_{2},\gamma_{2})$ are

$\alpha_{1}(\delta,\gamma;N)=\frac{\delta}{\gamma}-\frac{\gamma_{1}}{\gamma(\gamma^{2}+\gamma_{1}^{2})}+\frac{i}{\gamma^{2}+\gamma_{1}^{2}}$
(296)

and

$\alpha_{2}(\delta,\gamma;N)=\frac{\delta}{\gamma}+\frac{\gamma_{2}}{\gamma(\gamma^{2}+\gamma_{2}^{2})}+\frac{i}{\gamma^{2}+\gamma_{2}^{2}}.$
(297)

Then, for a given $N\in\mathbb{N}$, the contour $\mathcal{C}$ in (295) that
goes horizontally from $i$ to $i+1$ can be deformed to a contour $P(N)$ which
also goes from $i$ to $i+1$, but follows a different path. This new contour
$P(N)$, the Rademacher contour, consists in taking the upper arcs of the Ford
circles defined by the Farey sequence $\mathcal{F}_{N}$. If
$\delta_{1}/\gamma_{1}<\delta/\gamma<\delta_{2}/\gamma_{2}$ are three
consecutive Farey fractions, the upper arc of $\mathcal{C}(\delta,\gamma)$,
denoted by $\mathcal{C}_{\delta,\gamma,N}$, is the path that joins the two
points of tangency $\alpha_{1}(\delta,\gamma;N)$ and
$\alpha_{2}(\delta,\gamma;N)$ following the upper arc of
$\mathcal{C}(\delta,\gamma)$. For the fractions $0/1$ and $1/1$ we only take
the upper arcs lying in the interval $[0,1]$. The union of all the upper arcs
in $\mathcal{F}_{N}$ is $P(N)$.

Figure 1: On the left: Rademacher contour for $P(4)$. On the right: the circle
$C_{1/2}$ with $z_{1}(1,2,4)$ and $z_{2}(1,2,4)$.

Therefore, we can write the integral over $\mathcal{C}$ as a sum over
integrals over the upper arcs

$\int_{\mathcal{C}}=\sum_{\gamma=1}^{N}\sum_{\begin{subarray}{c}0\leq-\delta<\gamma\\\
(\delta,\gamma)=1\end{subarray}}\int_{\mathcal{C}_{-\delta,\gamma,N}}\equiv\sum_{\gamma,\delta}^{N}\int_{\mathcal{C}_{-\delta,\gamma,N}},$
(298)

where from now on we take $\delta$ to be negative, for later convenience. We
introduce the following transformation

$z=-i\gamma(\gamma\sigma+\delta),$ (299)

which maps the Ford circle $\mathcal{C}(-\delta,\gamma)$ to the circle with
centre $1/2$ and with radius $1/2$, and hence tangent to zero, denoted by
$C_{1/2}$. The points of tangency
$\alpha_{1}(-\delta,\gamma;N),\alpha_{2}(-\delta,\gamma;N)$ of
$\mathcal{C}(-\delta,\gamma)$ with $\mathcal{C}(-\delta_{1},\gamma_{1})$ and
$\mathcal{C}(-\delta_{2},\gamma_{2})$ with
$-\delta_{1}/\gamma_{1}<-\delta/\gamma<-\delta_{2}/\gamma_{2}$ become

$z_{1}(-\delta,\gamma;N)=\frac{\gamma^{2}}{\gamma^{2}+\gamma_{1}^{2}}+i\frac{\gamma\gamma_{1}}{\gamma^{2}+\gamma_{1}^{2}}$
(300)

and

$z_{2}(-\delta,\gamma;N)=\frac{\gamma^{2}}{\gamma^{2}+\gamma_{2}^{2}}-i\frac{\gamma\gamma_{2}}{\gamma^{2}+\gamma_{2}^{2}}.$
(301)

The upper arc joining $\alpha_{1}(-\delta,\gamma;N)$ and
$\alpha_{2}(-\delta,\gamma;N)$ becomes the arc on the right, namely the one
that joins $z_{1}(-\delta,\gamma;N)$ and $z_{2}(-\delta,\gamma;N)$ without
touching the imaginary axis. If $z$ is on the chord joining the points
$z_{1}(-\delta,\gamma;N)$ and $z_{2}(-\delta,\gamma;N)$, then
$|z|\leq\max(|z_{1}|,|z_{2}|)$. Using the property that successive Farey
fractions $-\delta/\gamma,-\delta^{\prime}/\gamma^{\prime}$ in ${\cal F}_{N}$
satisfy the inequalities

$\max(\gamma,\gamma^{\prime})\leq N\leq\gamma+\gamma^{\prime}-1,$ (302)

one obtains the bound $|z_{i}|<\frac{\sqrt{2}\gamma}{N}$, and hence

$|z|<\frac{\sqrt{2}\gamma}{N}$ (303)

for any $z$ on the chord. Moreover, using the triangle inequality, the length
of the chord has to be $\leq|z_{1}|+|z_{2}|$, and hence it may not exceed

$\frac{2\sqrt{2}\gamma}{N}.$ (304)

Now we perform the Rademacher expansion. We deform the initial contour in
(295) to the Rademacher contour $P(N)$, for some $N\in\mathbb{N}$,

$c_{0}^{F}(n)=\int_{\mathcal{C}}d\sigma e^{-2\pi
in\sigma}\,2\frac{E_{2}(\sigma)}{\eta^{24}(\sigma)}=\sum_{\gamma=1}^{N}\sum_{\begin{subarray}{c}0\leq-\delta<\gamma\\\
(\delta,\gamma)=1\end{subarray}}\int_{\mathcal{C}_{-\delta,\gamma,N}}d\sigma
e^{-2\pi in\sigma}\,2\frac{E_{2}(\sigma)}{\eta^{24}(\sigma)}.$ (305)

Next, we apply the modular transformation

$\begin{pmatrix}\alpha&\beta\\\ \gamma&\delta\end{pmatrix}\in{\rm
SL}(2,\mathbb{Z})\;\;\;,\;\;\;\alpha\in\mathbb{Z}/\gamma\mathbb{Z}$ (306)

to the integrand. Note that this maps the cusp $-\delta/\gamma$ to $+i\infty$.

Using (294), we obtain

$\displaystyle c_{0}^{F}(n)=$
$\displaystyle\sum_{\gamma,\delta}^{N}\int_{\mathcal{C}_{-\delta,\gamma,N}}d\sigma
e^{-2\pi
in\sigma}2\left((\gamma\sigma+\delta)^{10}\frac{E_{2}\left(\frac{\alpha\sigma+\beta}{\gamma\sigma+\delta}\right)}{\eta^{24}\left(\frac{\alpha\sigma+\beta}{\gamma\sigma+\delta}\right)}-\frac{6\gamma(\gamma\sigma+\delta)^{11}}{\eta^{24}\left(\frac{\alpha\sigma+\beta}{\gamma\sigma+\delta}\right)\pi
i}\right)$ $\displaystyle=$
$\displaystyle\sum_{\gamma,\delta}^{N}\int_{\mathcal{C}_{-\delta,\gamma,N}}d\sigma
e^{-2\pi
in\sigma}\sum_{m=-1}^{+\infty}\left((\gamma\sigma+\delta)^{10}c_{0}^{F}(m)-\frac{12}{\pi
i}\gamma(\gamma\sigma+\delta)^{11}d(m)\right)e^{2\pi
im\frac{\alpha\sigma+\beta}{\gamma\sigma+\delta}}.$ (307)

Next, on each of the arcs we perform the $z$-change of variables (299), using

$\frac{\alpha\sigma+\beta}{\gamma\sigma+\delta}=\frac{\alpha}{\gamma}-\frac{1}{\gamma(\gamma\sigma+\delta)},\hskip
14.22636pt\gamma\sigma+\delta=\frac{iz}{\gamma},$ (308)

and obtain

$\displaystyle c_{0}^{F}(n)=$
$\displaystyle\sum_{\gamma,\delta}^{N}\int_{z_{1}(-\delta,\gamma;N)}^{z_{2}(-\delta,\gamma;N)}dz\frac{i}{\gamma^{2}}e^{\frac{2\pi
n}{\gamma^{2}}z+2\pi
in\frac{\delta}{\gamma}}2\left(\left(\frac{iz}{\gamma}\right)^{10}\frac{E_{2}\left(\frac{\alpha}{\gamma}+\frac{i}{z}\right)}{\eta^{24}\left(\frac{\alpha}{\gamma}+\frac{i}{z}\right)}-\frac{6\gamma\left(\frac{iz}{\gamma}\right)^{11}}{\eta^{24}\left(\frac{\alpha}{\gamma}+\frac{i}{z}\right)\pi
i}\right)$ $\displaystyle=$
$\displaystyle\sum_{\gamma,\delta}^{N}\int_{z_{1}(-\delta,\gamma;N)}^{z_{2}(-\delta,\gamma;N)}dz\frac{i}{\gamma^{2}}e^{\frac{2\pi
n}{\gamma^{2}}z+2\pi
in\frac{\delta}{\gamma}}\sum_{m=-1}^{+\infty}\left(\left(\frac{iz}{\gamma}\right)^{10}c_{0}^{F}(m)-\frac{12}{\pi
i}\gamma\left(\frac{iz}{\gamma}\right)^{11}d(m)\right)$ $\displaystyle e^{2\pi
im\frac{\alpha}{\gamma}-2\pi\frac{m}{z}}.$ (309)

Now we split the sum in the integral into two pieces, namely the polar part,
which corresponds to $m=-1$,

$I^{-}(-\delta,\gamma;N)=\int_{z_{1}(-\delta,\gamma;N)}^{z_{2}(-\delta,\gamma;N)}dz\frac{i}{\gamma^{12}}e^{\frac{2\pi
n}{\gamma^{2}}z+2\pi
in\frac{\delta}{\gamma}}\left(-z^{10}c_{0}^{F}(-1)+\frac{12}{\pi}z^{11}d(-1)\right)e^{-2\pi
i\frac{\alpha}{\gamma}+\frac{2\pi}{z}},$ (310)

and the non-polar part,

$I^{+}(-\delta,\gamma;N)=\int_{z_{1}(-\delta,\gamma;N)}^{z_{2}(-\delta,\gamma;N)}dz\frac{i}{\gamma^{12}}e^{\frac{2\pi
n}{\gamma^{2}}z+2\pi
in\frac{\delta}{\gamma}}\sum_{m=0}^{+\infty}\left(-z^{10}c_{0}^{F}(m)+\frac{12}{\pi}z^{11}d(m)\right)e^{2\pi
im\frac{\alpha}{\gamma}-\frac{2\pi m}{z}}.$ (311)

Using the analysis given in apostol , it can be shown that the non-polar part
does not contribute in the limit $N\to+\infty$. The polar part, on the other
hand, is non-vanishing in this limit and given by444The integral should be
understood as an improper integral with both endpoints tending to $z=0$. The
integrand has an essential singularity at $z=0$. However, the remarkable
property of the Rademacher contour is that the integrand is bounded on this
path of integration, and therefore the integral over the circle $C_{1/2}$ is
well defined.

$c_{0}^{F}(n)=\sum_{\gamma=1}^{+\infty}\sum_{\begin{subarray}{c}0\leq-\delta<\gamma\\\
(\delta,\gamma)=1\end{subarray}}e^{2\pi
i\left(-\frac{\alpha}{\gamma}+n\frac{\delta}{\gamma}\right)}\int_{C_{1/2}}dz\frac{i}{\gamma^{12}}\left(-2z^{10}+\frac{12}{\pi}z^{11}\right)e^{\frac{2\pi
n}{\gamma^{2}}z+\frac{2\pi}{z}}.$ (312)

The sum over $\delta$ can be written as a classical Kloosterman sum,

$\text{Kl}(n,-1,\gamma)=\sum_{\begin{subarray}{c}0\leq-\delta<\gamma\\\
\alpha\delta=1\text{ mod }\gamma\end{subarray}}e^{2\pi
i\left(-\frac{\alpha}{\gamma}+n\frac{\delta}{\gamma}\right)},$ (313)

where $\alpha\in\mathbb{Z}/\gamma\mathbb{Z}$ is the modular inverse of
$\delta$, and hence uniquely specified. By performing the change of variables

$t=\frac{2\pi}{z},$ (314)

the $z$ integral over the circle $C_{1/2}$ becomes the $t$ integral over the
vertical line defined by $\text{Re}(t)=2\pi$,

$\displaystyle\int_{C_{1/2}}dz\frac{i}{\gamma^{12}}\left(-2z^{10}+\frac{12}{\pi}z^{11}\right)e^{\frac{2\pi
n}{\gamma^{2}}z+\frac{2\pi}{z}}$ $\displaystyle=\frac{1}{2\pi
i}\int_{2\pi-i\infty}^{2\pi+i\infty}dt\frac{1}{\gamma^{12}}\left(-2\left(\frac{2\pi}{t}\right)^{12}+\frac{12}{\pi}\left(\frac{2\pi}{t}\right)^{13}\right)e^{\frac{4\pi^{2}n}{\gamma^{2}t}+t},$
(315)

which equals a sum of modified Bessel functions of the first kind,

$I_{\nu}(z)=\frac{(\frac{1}{2}z)^{\nu}}{2\pi
i}\int_{\epsilon-i\infty}^{\epsilon+i\infty}dt\,\,t^{-\nu-1}e^{t+\frac{z^{2}}{4t}},$
(316)

and which results in

$c_{0}^{F}(n)=\sum_{\gamma=1}^{+\infty}\text{Kl}(n,-1,\gamma)\left(-\frac{4\pi}{n^{11/2}\gamma}I_{11}\left(\frac{4\pi\sqrt{n}}{\gamma}\right)+\frac{24}{n^{6}}I_{12}\left(\frac{4\pi\sqrt{n}}{\gamma}\right)\right).$
(317)

## References

  * (1) A. Dabholkar and J. A. Harvey, Nonrenormalization of the Superstring Tension, Phys. Rev. Lett. 63 (1989) 478.
  * (2) A. Dabholkar, Exact counting of black hole microstates, Phys. Rev. Lett. 94 (2005) 241301, [hep-th/0409148].
  * (3) J. M. Maldacena, G. W. Moore, and A. Strominger, Counting BPS black holes in toroidal Type II string theory, hep-th/9903163.
  * (4) R. Dijkgraaf, E. P. Verlinde, and H. L. Verlinde, Counting dyons in N=4 string theory, Nucl. Phys. B 484 (1997) 543–561, [hep-th/9607026].
  * (5) D. Shih, A. Strominger, and X. Yin, Recounting Dyons in N=4 string theory, JHEP 10 (2006) 087, [hep-th/0505094].
  * (6) H. Rademacher, On the Partition Function $p(n)$, Proceedings of the London Mathematical Society s2-43 (1938), no. 1 241.
  * (7) A. Dabholkar, F. Denef, G. W. Moore, and B. Pioline, Precision counting of small black holes, JHEP 10 (2005) 096, [hep-th/0507014].
  * (8) A. Sen, Negative discriminant states in N=4 supersymmetric string theories, JHEP 10 (2011) 073, [1104.1498].
  * (9) A. Chowdhury, A. Kidambi, S. Murthy, V. Reys, and T. Wrase, Dyonic black hole degeneracies in $\mathcal{N}=4$ string theory from Dabholkar-Harvey degeneracies, JHEP 10 (2020) 184, [1912.06562].
  * (10) G. L. Cardoso, S. Nampuri, and M. Rosselló, Arithmetic of decay walls through continued fractions: a new exact dyon counting solution in $\mathcal{N}$ = 4 CHL models, JHEP 03 (2021) 154, [2007.10302].
  * (11) F. Ferrari and V. Reys, Mixed Rademacher and BPS Black Holes, JHEP 07 (2017) 094, [1702.02755].
  * (12) S. Zwegers, Mock Theta Functions, 0807.4834.
  * (13) A. Dabholkar, S. Murthy, and D. Zagier, Quantum Black Holes, Wall Crossing, and Mock Modular Forms, 1208.4074.
  * (14) K. Bringmann and J. Manschot, From sheaves on $P^{2}$ to a generalization of the Rademacher expansion, Am. J. Math. 135 (2013), no. 4 1039–1065, [1006.0915].
  * (15) R. E. Borcherds, Automorphic forms on $O_{s+2,2}(\mathbb{R})$ and infinite products, Invent. Math. 120 (1995) 161.
  * (16) N. Banerjee, D. P. Jatkar, and A. Sen, Asymptotic Expansion of the N=4 Dyon Degeneracy, JHEP 05 (2009) 121, [0810.3472].
  * (17) S. Murthy and B. Pioline, A Farey tale for N=4 dyons, JHEP 09 (2009) 022, [0904.4253].
  * (18) D. Zagier and N.-P. Skoruppa, A trace formula for Jacobi forms, Journal fuer die Reine und Angewandte Mathematik 393 (1989) 168–198.
  * (19) J. Gomes, Generalized Kloosterman Sums from M2-branes, 1705.04348.
  * (20) H. D. Kloosterman, The Behavior of General Theta Functions Under the Modular Group and the Characters of Binary Modular Congruence Groups, Annals of Mathematics 47 (1946), no. 3 317.
  * (21) A. Sen, Black Hole Entropy Function, Attractors and Precision Counting of Microstates, Gen. Rel. Grav. 40 (2008) 2249–2431, [0708.1270].
  * (22) K. Bringmann and J. Lovejoy, Dyson’s Rank, overpartitions, and weak Maass forms, Int. Math. Res. Not. 19 (2007) [0708.0692].
  * (23) J. R. David and A. Sen, CHL Dyons and Statistical Entropy Function from D1-D5 System, JHEP 11 (2006) 072, [hep-th/0605210].
  * (24) G. Bossard, C. Cosnier-Horeau, and B. Pioline, Exact effective interactions and 1/4-BPS dyons in heterotic CHL orbifolds, SciPost Phys. 7 (2019), no. 3 028, [1806.03330].
  * (25) M. C. N. Cheng and E. Verlinde, Dying Dyons Don’t Count, JHEP 09 (2007) 070, [0706.2363].
  * (26) A. Sen, Quantum Entropy Function from AdS(2)/CFT(1) Correspondence, Int. J. Mod. Phys. A 24 (2009) 4225–4244, [0809.3304].
  * (27) S. Murthy and V. Reys, Single-centered black hole microstate degeneracies from instantons in supergravity, JHEP 04 (2016) 052, [1512.01553].
  * (28) G. L. Cardoso, B. de Wit, J. Kappeli, and T. Mohaupt, Asymptotic degeneracy of dyonic N = 4 string states and black hole entropy, JHEP 12 (2004) 075, [hep-th/0412287].
  * (29) H. Rademacher, Lectures on Analytic Number Theory.  Tata Institute of Fundamental Research, 1954-55.
  * (30) T. Apostol, Modular Functions and Dirichlet Series in Number Theory.  Springer Verlag, 1990.
  * (31) R. Dijkgraaf, J. M. Maldacena, G. W. Moore, and E. P. Verlinde, A Black hole Farey tail, hep-th/0005003.