Nonholomorphic Ramanujan-type congruences for Hurwitz class numbers

Edited by Kenneth A. Ribet, University of California, Berkeley, CA, and approved July 28, 2020 (received for review March 31, 2020)
August 27, 2020
117 (36) 21953-21961


Hurwitz class numbers were introduced over 100 y ago, and they impact different areas of mathematics. In particular, their generating function is a so-called mock modular form. Despite their importance, essentially nothing has been known about the divisibility properties of Hurwitz class numbers on arithmetic progressions. Our work provides results on such divisibility properties, which differ drastically from known divisibility results for coefficients of other mock modular forms.


In contrast to all other known Ramanujan-type congruences, we discover that Ramanujan-type congruences for Hurwitz class numbers can be supported on nonholomorphic generating series. We establish a divisibility result for such nonholomorphic congruences of Hurwitz class numbers. The two key tools in our proof are the holomorphic projection of products of theta series with a Hurwitz class number generating series and a theorem by Serre, which allows us to rule out certain congruences.
The study of class numbers for imaginary quadratic fields and the related Hurwitz class numbers has a long and rich history. Their divisibility properties were first studied as early as the 1930s (1), but have proved highly elusive. Such divisibility properties are directly reflected in the existence of torsion elements in class groups. The Cohen–Lenstra heuristic (2) has been the guiding principle in the topic, providing conjectures of a statistical nature for the factorization of class numbers; see ref. 3 for an experimentally supported refinement. However, essentially nothing is known about strictly regular patterns of divisibility as opposed to statistical patterns. In this light, it is natural to study Ramanujan-type congruences, that is, divisibility properties on arithmetic progressions.
The study of congruences of modular forms originates with the Ramanujan congruences (4) for the partition function,
p(5n+4)0(mod5),p(7n+5)0  (mod7),p(11n+6)0  (mod11).
It is now known that all weakly holomorphic modular forms, including the generating function for p(n), satisfy congruences (57), which arise from the theory of Galois representations associated to modular forms. Zagier (8) showed that the Hurwitz class numbers are Fourier coefficients of a weight 3/2 mock modular form (in today’s terminology), that is, the holomorphic part of a harmonic Maass form (911). Much less is known about congruences in this setting. However, congruences for other weight 3/2 mock modular forms have been studied by several authors (1216).
Ramanujan-type congruences for the Hurwitz class numbers H(D) have not appeared in the literature. For this work, we have employed a computer search to discover many examples of such congruences for H(D), which can then be confirmed with our method of Section 2 in combination with Sturm bounds for modular forms modulo a prime; see also Remark 2 following Theorem 0.1. For instance, one finds that
H(53n+25)0  (mod5),H(73n+147)0  (mod7),H(113n+242)0  (mod11).
A common theme of all three of these congruences, written in the form H(an+b)0  (mod), is that b is a square modulo a, which yields a generating series for H(an+b) that is mock modular, that is, has a nonholomorphic modular completion. This differs from the congruences for mock theta functions of weight 1/2, which are so far only known to occur when the generating function is a holomorphic modular form (15). Our main theorem provides the following divisibility result for such nonholomorphic congruences:
Theorem 0.1 Fix a prime >3, aZ1, and bZ. If b is a square modulo a and
H(an+b)0  (mod)
for all integers n, then a.
Remarks on Theorem 0.1.
We used the Hurwitz–Eichler relations to compute Hurwitz class numbers H(D) for D<3109. We did not employ any computer algebra system, but implemented our software in C/C++/Julia from scratch, relying on the Fast Library for Number Theory (FLINT) (17) only for modular arithmetics. The code is available in Zenodo at
All examples of Ramanujan-type congruences of Hurwitz class numbers that we discovered, including the nonholomorphic ones, can be explained by a Hecke-type factorization of Hurwitz class numbers (Eq. 21). Note that all such nonholomorphic Ramanujan-type congruences for H(n) satisfy the conclusion of Theorem 0.1. While it is not known whether this factorization implies all nonholomorphic Ramanujan-type congruences, our experimental data suggests that it does. Thus, Theorem 0.1 provides evidence for this speculation.
In Section A, we point out that Eq. 21 also implies congruences modulo powers of .
There are also examples of congruences H(an+b)0  (mod) where b is not a square modulo a. However, our computational data reveals that, in those cases, does not divide a, which is in contrast to other known Ramanujan-type congruences (see refs. 15 and 18). The first examples for {5,7,11} are
H(33n+9)0  (mod5),H(53n+50)0  (mod7),H(29n+192)0  (mod11).
The methods in this work likely generalize to all mock modular forms of weight 3/2. In particular, congruences of the Andrews spt function (13) should be subject to requirements similar to the ones presented in Theorem 0.1. On the other hand, both the divisibility and the square class conditions that appear in the case of mock modular forms of weight 1/2 (see ref. 15) seem to be of a different nature and originate in the principal part of mock modular forms.
The method of our proof is as follows: We combine a holomorphic projection argument for products of theta series and mock modular forms, which appeared first in ref. 19, with a theorem by Serre (20, 21) that is rooted in the Chebotarev Density Theorem. The latter was employed by Ono (5) in order to establish his celebrated results on the distribution of the partition function modulo primes. Ono applied it to establish congruences, while our proof proceeds by contradiction and uses Serre’s theorem to rule out certain congruences.

1. Preliminaries

A recent reference which contains most of the necessary background material for this paper is ref. 22; a more classical one on the theory of modular forms is ref. 23.

A. Modular Forms.

Let Γ0(N), Γ1(N), and Γ(N) be the usual congruence subgroups of SL2(Z), let Mk(Γ) be the space of modular forms of integral or half-integral weight k for ΓSL2(Z), and let Mk(Γ) be the corresponding space of harmonic Maass forms (satisfying the moderate growth condition at all cusps). We also consider quasi-modular forms of integral weight (24, 25). Moreover, H denotes the Poincaré upper half plane, and throughout τH, y=Im(τ), and e(sτ)exp(2πisτ) for sQ.
For a holomorphic modular form f(τ)=m0c(f,m)e(mτ)M2k(Γ(N)) with k1 and NZ1, we recall its nonholomorphic Eichler integral,
where Γ stands for the upper incomplete Gamma function.

B. Generating Series of Hurwitz Class Numbers.

Zagier (8) showed that the holomorphic generating series DH(D)e(Dτ) of Hurwitz class numbers admits the following modular completion:
θθ1,0M12(Γ0(4))withθa,b(τ)nZnb  (moda)en2τaM12(Γ(4a)),aZ1,bZ.
For aZ1 and bZ, we define the following operator on Fourier series expansions of nonholomorphic modular forms:
Ua,bnZc(f;n;y)e(nτ)nZnb  (moda)cf;n;yaenτa.
The holomorphic part of Ua,bE32(τ) is the generating series of Hurwitz class numbers H(an+b) for nZ. A Hecke-theory-like computation (see also ref. 26) shows that
Moreover, we have
Ua,bθ=β2b  (moda)θa,βandUa,bθ*=β2b  (moda)aθa,β*.
In particular, if b is not a square modulo a, then Ua,bE3/2 is a holomorphic modular form.

C. A Theorem by Serre.

The following theorem by Serre and its corollary allow us to disprove that a given generating series is a quasi-modular form modulo a prime. Recall that a rational number is called integral for a prime , if its denominator is not divisible by .
Theorem 1.1 [Deligne-Serre (27) and Serre (20, 21)] Fix an odd prime and k,NZ1. Then there are infinitely many primes p1  (modN) such that, for every fMk(Γ1(N)) with -integral Fourier coefficients, we have
c(f;npr)(r+1)c(f;n)  (mod)
for all nZ coprime to p and all rZ0.
Proof. The proof of Lemma 9.6 of ref. 27, which is stated in the special case of weight 1, extends verbatim.
Corollary 1.2 Fix a prime >3 and positive integers k and N. Then there are infinitely many primes p1  (modN) such that, for every quasi-modular form f of weight k for Γ1(N) with -integral Fourier coefficients, we have the congruence Eq. 7.
Proof. Recall the weight 2 quasi-modular form
Quasi-modular forms are polynomials in E2 whose coefficients are modular forms. More specifically, a quasi-modular form of weight k for Γ1(N) can be written as
Recall also that the weight 1 and level 1 Eisenstein series E1 is a modular form (here we use that >3) that is congruent to 1 modulo , and that the weight +1 and level 1 Eisenstein series E+1 is a modular form that is congruent to E2 modulo . Thus,
n=0dE2nfnE1dn=0dE2nfnn=0d(E2E1)nE1dnfnn=0dE+1nE1dnfn  (mod),
which allows us to apply Theorem 1.1 to the modular form of weight k+d(1) on the right-hand side.

D. Holomorphic Projection.

We now revisit holomorphic projection, which allows one to map continuous functions with certain growth and modular behavior to holomorphic modular forms (e.g., see refs. 28 and 29). It is convenient for us to refer to ref. 19 as a reference, since it provides a variant that does not project to cusp forms. Fix a weight kZ, k2, and a level NZ1.
Consider an N-periodic continuous function f:HC with Fourier series expansion
subject to the following conditions: For some a>0 and all γSL2(Z), there are coefficients c(f|kγ;0)C, such that (f|kγ)(τ)=c(f|kγ;0)+O(ya) as y; for all n1/NZ>0, we have c(f;n;y)=O(y2k) as y0. The holomorphic projection operator of weight k is defined by
Remark 1.3 The formulation in ref. 19 is missing the limit s0, which is required to ensure convergence in all situations. Nevertheless, the arguments in ref. 19 are still valid without any restrictions after adding that missing regularization.
Proposition 4 and Theorem 5 of ref. 19 provide some key properties of the holomorphic projections operator (for vector-valued modular forms): If f is holomorphic, then πkhol(f)=f. Furthermore, if f transforms like a modular form of weight 2 for the group Γ1(N), then π2hol(f) is a quasi-modular form of weight 2 for Γ1(N).

2. Proof of Theorem 0.1

We will apply holomorphic projection to products of holomorphic modular forms of weight 1/2 and harmonic Maass forms of weight 3/2. These products, when inserted into Eq. 8, lead to the integrals evaluated in the next two lemmas.
Lemma 2.1 Given nQ>0, we have
Proof. We suppress the limit s0 from our calculation, since the integral is convergent at s=0. We then have to evaluate
Lemma 2.2 Given rational numbers n,ñQ satisfying ñ<0 and n+ñ>0, we have
Proof. Again, we suppress the limit s0 from our calculation, since the integral is convergent at s=0. We have to evaluate
We apply case 1 of (6.455) on p. 657 of ref. 30 with α4π|ñ|, β4π(n+ñ), μ1, and ν1/2. The assumptions Re(α+β)=4π((n+ñ)+|ñ|)>0 (since n+ñ>0), Re(μ)=1>0, and Re(μ+ν)=1/2>0 are satisfied. As a result, we obtain
To evaluate the hypergeometric function, we employ 15.4.17 of ref. 31 with a1/2. It allows us to simplify the previous expression to
We combine this with the leading factor 4π(n+ñ) in the defining Eq. 8 of the holomorphic projection to finish the proof.
The next three results compute the nth coefficient of π2hol(Ua,bE32)(θa,β+θa,β) for certain n. The first elementary lemma establishes the existence of a subprogression of aZ+b={an+b:nZ} satisfying arithmetic conditions that will be useful in the proof of Theorem A. To state it, we let ordp(a) be the maximal exponent for powers of a prime p dividing an nonzero integer a.
Lemma 2.3 Let ãZ1 and bZbe such that b is a square modulo ã. Denote by P the set of prime divisors of ã. Then there exist aZ1 and bZsuch that
We have ãa, and if p is a prime divisor of a then pP.
The integer b is a square modulo a.
We have
where h(p)=ordp(a) and k(p)=ordp(b).
For pP and for all disjoint sets P1,P2 with P1P2=P\{p}, we have
4bpk(p)qP1qk(q)qP2q2h(q)  (modph(p)),  ifp2,pk(p)+2qP1qk(q)qP2qh(q)  (modph(p)),  ifp=2.
Proof. In order to produce integers a and b that satisfy Conditions 1 to 4, we initially set a=ã and b=b and then repeatedly replace a and b by aa and b+ab for integers a,b in such a way that successively more of these conditions are met. In accordance with Condition 1, the prime divisors of a must be elements of P.
Recall that h(p)=ordp(a) and k(p)=ordp(b). For each prime pP, we define apa/ph(p) and similarly define bpb/pk(p). We start by making the substitutions aaa and bb+ab several times, in such a way that (b+ab) is still a square modulo aa (hence Condition 2 remains true) and that Condition 3 is satisfied.
First, choose a=1, and pick a suitable b such that h(p)k(p) holds for each pP after replacing b by b+ab. Next, let P0{pP:h(p)=k(p)}. For each pP0, let e(p)=1 if h(p) is even, and let e(p)=2 if h(p) is odd. Consider a=pP0pe(p). Let b be any integer satisfying gcd(b,pP\P0p)=1 and
b(1+bp)ap1  (modp),  ifpP0and2h1(p);(p+bp)ap1  (modp2),ifpP0and2h1(p).
Note that the minus signs of the terms (1+bp) and (p+bp) are required to ensure that Condition 2 holds after replacing a and b by aa and b+ab. After this substitution, we may assume that h(p)>k(p) for all pP.
We take this idea a step further when p=2. If h(2)k(2)=1, then we choose a=2, and b is 0 or 1 depending on whether bp is 3 or 1 modulo 4. We find that we may assume h(2)k(2)2. Similarly, if we assume that h(2)k(2)=2, then we can choose a=2, and b is 0 or 1 depending on whether bp is 7 or 3 modulo 8. Thus, we can assume that h(2)k(2)3.
After making the above assumptions on h(p) and k(p), we conclude that b is also a square modulo aa for any a satisfying Condition 1. In particular, after choosing an appropriate a, we may assume that h(p) is as large as we wish. Thus, we can assume that Condition 3 holds.
It remains to make one more substitution, aaa and bb+ab, in order to ensure Condition 4. Observe that the right-hand side of Eq. 10 can take, at most, 2|P|1 different values, corresponding to the 2|P|1 different choices of P1 and P2. Given a, we let h(p)ordp(a) for pP. Any choice of b preserves Conditions 1, 2, and 3, and this yields ph(p) different values for the left-hand side of Eq. 10 after replacing b by b+ab. Finally, choose a in such a way that ph(p)>2|P|1 for every pP, and then pick a suitable b to validate Condition 4.
The next result will be useful in the computation of the Fourier series coefficients of π2hol(Ua,bE32)(θa,β+θa,β). We continue using P to denote the set of prime divisors of a, and we assume the definition of h(p) and k(p) from Lemma 2.3. We also let β be such that β2b(moda). Thus, we have a=paph(p), and β=βpapk(p)/2, where β is coprime to a.
Lemma 2.4 Assume that aZ1 and bZ satisfy Conditions 1 to 4 in Lemma 2.3, and let be a prime that does not divide a.
For each prime pP, let q(p) be a prime that is congruent 1 modulo ph(p), congruent to 2β/pk(p)/2 modulo ph(p)k(p)/2, and congruent modulo to a unit such that
ph(p)+q(p)pk(p)1  (mod),  ifp2,orph(p)+q(p)pk(p)+11  (mod),  ifp=2.
Moreover, let
Then we have
β2b  (moda)ϵ=±1ana=d1d2d1,d2>0d1ϵβ+β  (moda)d2ϵββ  (moda)d1+d22  (mod).
Proof. Because the symmetry ββ swaps d1 and d2, we have
β2b  (moda)ϵ=±1ana=d1d2d1,d2>0d1ϵβ+β  (moda)d2ϵββ  (moda)d1+d2=2β2b  (moda)ϵ=±1ana=d1d2d1,d2>0d1ϵβ+β  (moda)d2ϵββ  (moda)d1.
If p2, the square roots β of b  (modph(p)) are of the form ±β+ph(p)k(p)β for some βZ/pk(p)Z. In the sum, we therefore have the conditions
d1ϵβ±β+ph(p)k(p)β  (modph(p)),d2ϵββph(p)k(p)β  (modph(p)).
Using h(p)>2k(p), asserted by Condition 3 of Lemma 2.3, and Eq. 10, we find that the only possibility that ana=d1d2 satisfies these congruences is if we have ϵ=+1, β0  (modph(p)), and
The case of p=2 allows for more square roots of b  (mod2h(p)). Specifically, β={1,c3,c5,c7}β+ph(p)k(p)β, where, by the set notation, we indicate one of the factors occurs and c33  (mod8), c55  (mod8), and c77  (mod8) are roots of 1 modulo 2h(2). We now have the conditions
d1{2,1+c3,1+c5,1+c7}β+2h(2)k(2)β  (mod2h(2)),d2{0,1c3,1c5,1c7}β2h(2)k(2)β  (mod2h(2)).
We use that k(p)+3<h(p)k(p), asserted by Condition 3 of Lemma 2.3, and Eq. 10 in order to see that the only possibilities are ϵ=+1, β0  (mod2h(2)), and the divisibilities in Eq. 12 with p=2.
Observe that modulo , the sum actually factors for our choice of na. Specifically, we have
β2b  (moda)ana=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1=pap2ph(p)+q(p)pk(p)1,if2a;2h(2)+q(2)2k(2)+1,if2a.
Our choice of q(p) ensures that this is congruent to 1 modulo . The additional factor 2 in Eq. 11 yields the desired result.
Next, we compute certain coefficients of π2hol(Ua,bE32)(θa,β+θa,β). We assume the notation above for na, k(p), h(p), and β.
Proposition 2.5 Assume that H(an+b)0(mod) for all n. Furthermore, assume that β2b  (moda), and that a and b satisfy Conditions 1 to 4 of Lemma 2.3.
Then π2hol(Ua,bE32)(θa,β+θa,β) is a quasi-modular form for Γ1(4a) and
c(napq)2(1+q)  (mod)andc(nap2q)2(1+p+q)  (mod)
for any primes p,q1  (mod) such that
Remark 2.6 In light of Lemma 2.3, the assumptions on a and b are no restriction. For any a,b with b a square modulo a, we can find a subprogression of aZ+b satisfying these conditions. Furthermore, for any sufficiently large p1  (moda), there is a prime q1  (mod) satisfying the Conditions in Eq. 14—this follows from the Prime Number Theorem for arithmetic progressions.
Proof. As we assume that H(an+b)0  (mod) for all nZ, we have
π2hol(Ua,bE32)(θa,β+θa,β)=Ua,bD=0H(D)e(Dτ)(θa,β+θa,β)+116ππ2hol(Ua,bθ*)(θa,β+θa,β)116ππ2hol(Ua,bθ*)(θa,β+θa,β)  (mod).
Now, Eqs. 2 and 6 lead us to the study of aθa,β*, which arise from Ua,bθ*. Write δ for the Kronecker δ-function. For general β,βZ, we use Eq. 1 to compute that aθa,β*(τ)θa,β(τ) equals
2aδβ0  (moda)mβ  (moda)y12em2τa2πmβ  (moda)mβ  (moda)m0|m|Γ12,4πm2aye(m2m2)τa.
We apply Lemmas Eq. 2.1 and Eq. 2.2 to find that π2holaθa,β*(τ)θa,β(τ) is equal to
4πδβ0  (moda)mβ  (moda)m0|m|em2τa+mβ  (moda)mβ  (moda)m0m2m2|m|+|m|e(m2m2)τa.
Summarizing, we find that
cπ2holaθa,β*(τ)θa,β(τ);n=4πδβ0  (moda)mβ  (moda)m0an=m2|m|+anmβ  (moda)mβ  (moda)m0an=m2m21|m|+|m|.
We can drop the first contribution, since b0  (moda) and hence β0  (moda). It remains to analyze the second term on the right-hand side.
When writing an=m2m2=(m+m)(mm), we recognize that the summation runs over factorizations of an. Assume that an=d1d2 is a factorization corresponding to (m+m)(mm); then m=(d1+d2)/2 and m=(d1d2)/2. Since an>0, we conclude that d1 and d2 have the same sign. We treat only the positive case; the negative case yields the same sum and hence contributes an additional factor of 2 in Eq. 17.
Since d1,d2>0, we have m>0. If we assume that an is not a square, then m0, and the sign of m is positive if d1>d2 and negative if d2>d1. As a result, we find that |m|+|m| equals the larger factor in d1d2. Summarizing, we have
anmβ  (moda)mβ  (moda)m0an=m2m21|m|+|m|=2an=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1d2d1δd1>d2+d2δd2>d1=2an=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1δd1<d2+d2δd2<d1.
We next want to separate the Archimedean and non-Archimedean conditions on the right-hand side.
We write n=nan, where n is either pq or p2q and where p and q are as in the statement of the proposition. Then, for any factorization n=d1d2, we have d1/d2>ana or d2/d1>ana. This assumption ensures that, in the resulting factorization of an, only the Archimedean condition associated with the factorization n=d1d2 plays a role. Summarizing, we have
an=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1δd1<d2+d2δd2<d1=anan=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1δd1<d2+d2δd1<d2,
where d1=gcd(d1,n) and d2=gcd(d2,n). Since gcd(ana,n)=1, we can sum over two factorizations ana=da,1da,2 and n=d1d2. Every factor of n is congruent to 1 modulo a, so the congruence condition applies only to the factors of ana. We have
anan=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1δgcd(d1,n)<gcd(d2,n)+d2δgcd(d1,n)<gcd(d2,n)  =ana=da,1da,2n=d1d2da,1,da,2,d1,d2>0da,1β+β  (moda)da,2ββ  (moda)da,1d1δd1<d2+da,2d2δd2<d1=ana=d1d2d1,d2>0d1β+β  (moda)d2ββ  (moda)d1+d2n=d1d2d1,d2>0d1δd1<d2+d2δd2<d1.
By Lemma 2.4, the first factor in Eq. 18 is congruent to 2 modulo .
We next inspect the second factor in Eq. 18. We have
We now combine the Archimedean and non-Archimedean factors in Eq. 18 to determine the Fourier coefficients of Eq. 15. Our final expression in Eq. 20 receives several contributions: 1/16π from Eq. 15; 4π from Eq. 16; 2 from Eq. 17; 2 from Lemma 2.4, computing the first factor in Eq. 18; and 2(1+p) or 2(1+q+p) from Eq. 19, computing the second factor in Eq. 18. This yields
cπ2holUa,bE32(θa,β+θa,β);naqp2(1+q)      (mod),cπ2holUa,bE32(θa,β+θa,β);naqp22(1+q+p)  (mod).
We are now in a position to apply Theorem 1.1 and its Corollary 1.2.
Proof of Theorem 0.1. We are now in position to apply Theorem 1.1 to deduce a contradiction. Replacing a and b with aa and bab, where a and b are as in Lemma 2.3, we may assume that a and b satisfy the conditions of Proposition 2.5.
Theorem 1.1 asserts that there are infinitely many primes p1  (moda) such that c(f;npr)(r+1)c(f;n)  (mod) for all nZ coprime to p, rZ0, and fM2(Γ1(4a)). For sufficiently large p, there is a prime q with q/1  (mod) and q1  (moda) that satisfies Eq. 14 (see Remark 2.6).
If the qth Fourier coefficient of π2holUa,bE32(θa,β+θa,β) is divisible by , then the two congruences in Eq. 20 yield the contradiction 1+q1+q+p0  (mod). Otherwise, they incur the relation
3(1+q)2(1+q+p)  (mod),
which is equivalent to q1  (mod), a contradiction.

A. Hecke-Type Congruences.

The fact that DH(D)e(Dτ) is a Hecke eigenform is conveniently captured by the Hurwitz class number formula. For fundamental discriminants D and positive integers f, the formulas for class numbers of imaginary quadratic fields and H(D) (see, e.g., pp. 228 and 230 of ref. 32) imply the following:
where the product is over primes p dividing d and where w(D)6 is the number of roots of unity in the quadratic order of discriminant D. Throughout the paper, we follow Zagier (8), who defines H(D) for nonnegative arguments, while Cohen (32) uses the opposite sign convention. We restrict to congruences modulo powers of primes >3 and hence may ignore the factor w(Df2)/w(D). We assume no further knowledge of H(D), and we only employ the sum over divisors d of f in Eq. 21 to obtain congruences for H(an+b). Note that this sum is multiplicative in f, which later allows us to restrict to the case of prime powers a.
Recall the congruences
H(53n+25)0  (mod5),H(73n+147)0  (mod7),H(113n+242)0  (mod11).
Observe that, for 53n+25=(5n+1)52=Df2, with a fundamental discriminant D, we have D1  (mod5) and 5f. Thus, writing f5f for the highest power of 5 that divides f, we have f51, and the right-hand side of Eq. 21 has the factor
df5d5d115D51D50  (mod5),
which shows that H(53n+25)0  (mod5). The congruences modulo 7 and 11, and the congruences in the remark after Theorem 0.1, follow similarly.
The above reasoning extends to powers m for arbitrary primes as follows: Assume that a=e and b=cu for an integer u with gcd(,u)=1. For simplicity, we further suppose that e>c2. Set c=c/21 and c=min{c,m}. We have the factorization
which yields cf and D0  (mod) if c is odd and Du  (mod) if c is even. Thus, the right-hand side of Eq. 21 has the factor
dcdd11D=1+n=1cn11D1+n=1cn1D=σ1c11D+c  (modm).
As a result, we find congruences modulo m if c2m (and hence cm) is even and u is a square modulo . In particular, we obtain nonholomorphic Ramanujan-type congruences for all primes >3.

Materials and Methods

Computer code (see Remark 1 following Theorem 0.1) is available at the second author’s homepage and at 10.5281/zenodo.3924593.

Data Availability

Code has been deposited in Zenodo (DOI:


We thank Scott Ahlgren, Jeremy Lovejoy, and the anonymous referee for valuable suggestions.


A. Scholz, Über die Beziehung der Klassenzahlen quadratischer Körper zueinander. J. Reine Angew. Math. 166, 201–203 (1932).
H. Cohen, H. W. Lenstra Jr, “Heuristics on class groups of number fields” in Number Theory, Noordwijkerhout 1983, H. Jager, Ed. (Lecture Notes in Math, Springer, Berlin, Germany, 1984), vol. 1068, pp. 33–62.
S. Holmin, N. C. Jones, P. Kurlberg, C. McLeman, K. L. Petersen, Missing class groups and class number statistics for imaginary quadratic fields. Exp. Math. 28, 233–254 (2019).
S. Ramanujan, Congruence properties of partitions. Proc. Lond. Math. Soc. 18, xix–xx (1920).
K. Ono, Distribution of the partition function modulo m. Ann. Math. 151, 293–307 (2000).
S. Ahlgren, K. Ono, Congruence properties for the partition function. Proc. Natl. Acad. Sci. U.S.A. 98, 12882–12884 (2001).
S. Treneer, Congruences for the coefficients of weakly holomorphic modular forms. Proc. Lond. Math. Soc. 93, 304–324 (2006).
D. B. Zagier, Nombres de classes et formes modulaires de poids 3/2. C. R. Acad. Sci. Paris Sér. A-B 281, A883–A886 (1975).
K. Ono, The Web of Modularity: Arithmetic of the Coefficients of Modular Forms and q-Series (CBMS Regional Conference Series in Mathematics, American Mathematical Society, Washington, DC, 2004), vol. 102.
K. Ono, “Unearthing the visions of a master: Harmonic Maass forms and number theory” in Current Developments in Mathematics, 2008, D. Jerison et al., Eds. (International Press, Somerville, MA, 2009), pp. 347–454.
W. Duke, Almost a century of answering the question: What is a mock theta function?Not. Am. Math. Soc. 61, 1314–1320 (2014).
K. Bringmann, J. Lovejoy, Overpartitions and class numbers of binary quadratic forms. Proc. Natl. Acad. Sci. U.S.A. 106, 5513–5516 (2009).
K. Ono, Congruences for the Andrews spt function. Proc. Natl. Acad. Sci. U.S.A. 108, 473–476 (2011).
S. Ahlgren, K. Bringmann, J. Lovejoy.-adic properties of smallest parts functions. Adv. Math. 228, 629–645 (2011).
N. Andersen, Classification of congruences for mock theta functions and weakly holomorphic modular forms. Q. J. Math. 65, 781–805 (2014).
G. E. Andrews, D. Passary, J. A. Sellers, A. J. Yee, Congruences related to the Ramanujan/Watson mock theta functions ω(q) and ν(q). Ramanujan J. 43, 347–357 (2017).
W. Hart, F. Johansson, S. Pancratz, FLINT: Fast Library for Number Theory Version 2.5, ed. 2. Accessed 3 April 2019.
C. S. Radu, Proof of a conjecture by Ahlgren and Ono on the non-existence of certain partition congruences. Trans. Am. Math. Soc. 365, 4881–4894 (2013).
Ö. Imamoğlu, M. Raum, O. K. Richter, Holomorphic projections and Ramanujan’s mock theta functions. Proc. Natl. Acad. Sci. U.S.A. 111, 3961–3967 (2014).
J. P. Serre, Divisibilité des coefficients des formes modulaires de poids entier. C. R. Acad. Sci. Paris Sér. A 279, 679–682 (1974).
J. P. Serre, Divisibilité de certaines fonctions arithmétiques. Enseign. Math. 22, 227–260 (1976).
K. Bringmann, A. Folsom, K. Ono, L. Rolen, Harmonic Maass Forms and Mock Modular Forms: Theory and Applications (American Mathematical Society Colloquium Publications, American Mathematical Society, Providence, RI, 2017), vol. 64.
S. Lang, Introduction to Modular Forms (Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences], Springer-Verlag, Berlin, Germany, 1995), vol. 222.
D. Zagier, Modular forms and differential operators. Proc. Indian Acad. Sci. Math. Sci. 104, 57–75 (1994).
M. Kaneko, D. B. Zagier, “A generalized Jacobi theta function and quasimodular forms” in The Moduli Space of Curves (Texel Island, 1994), R. Dijkgraaf, C. Faber, G. van der Geer, Eds. (Progress in Mathematics, Birkhäuser Boston, Boston, MA, 1995), vol. 129, pp. 165–172.
H. Cohen, Sums involving the values at negative integers of L-functions of quadratic characters. Math. Ann. 217, 271–285 (1975).
P. Deligne, J. P. Serre, Formes modulaires de poids 1. Ann. Sci. École Norm. Sup. 7, 507–530 (1974).
J. Sturm, Projections of C automorphic forms. Bull. Am. Math. Soc. 2, 435–439 (1980).
B. H. Gross, D. B. Zagier, Heegner points and derivatives of L-series. Invent. Math. 84, 225–320 (1986).
I. S. Gradshteyn, I. M. Ryzhik, Table of Integrals, Series, and Products (Elsevier, ed. 7, Amsterdam, The Netherlands, 2007).
NIST Digital Library of Mathematical Functions, Version 1.0.27. Accessed 20 June 2020.
H. Cohen, A Course in Computational Algebraic Number Theory (Graduate Texts in Mathematics, Springer-Verlag, Berlin, Germany, 1993), vol. 138.

Information & Authors


Published in

Go to Proceedings of the National Academy of Sciences
Go to Proceedings of the National Academy of Sciences
Proceedings of the National Academy of Sciences
Vol. 117 | No. 36
September 8, 2020
PubMed: 32855297


Data Availability

Code has been deposited in Zenodo (DOI:

Submission history

Published online: August 27, 2020
Published in issue: September 8, 2020


  1. Hurwitz class numbers
  2. Ramanujan-type congruences
  3. holomorphic projection
  4. Chebotarev density theorem


We thank Scott Ahlgren, Jeremy Lovejoy, and the anonymous referee for valuable suggestions.


This article is a PNAS Direct Submission.



Olivia Beckwith1
Department of Mathematics, University of Illinois at Urbana–Champaign, Urbana, IL 61801;
Martin Raum1
Chalmers tekniska högskola och Göteborgs Universitet, Institutionen för Matematiska vetenskaper, SE-412 96 Göteborg, Sweden;
Department of Mathematics, University of North Texas, Denton, TX 76203


To whom correspondence may be addressed. Email: [email protected].
Author contributions: O.B., M.R., and O.K.R. performed research and wrote the paper.
O.B., M.R., and O.K.R. contributed equally to this work.

Competing Interests

The authors declare no competing interest.

Metrics & Citations


Note: The article usage is presented with a three- to four-day delay and will update daily once available. Due to ths delay, usage data will not appear immediately following publication. Citation information is sourced from Crossref Cited-by service.

Citation statements



If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited by


    View Options

    View options

    PDF format

    Download this article as a PDF file


    Get Access

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Personal login Institutional Login

    Recommend to a librarian

    Recommend PNAS to a Librarian

    Purchase options

    Purchase this article to get full access to it.

    Single Article Purchase

    Nonholomorphic Ramanujan-type congruences for Hurwitz class numbers
    Proceedings of the National Academy of Sciences
    • Vol. 117
    • No. 36
    • pp. 21825-22604







    Share article link

    Share on social media