Youness Lamzouri
email: lamzouri@mathstat.yorku.ca

LARGE MOMENTS AND EXTREME VALUES OF CLASS NUMBERS OF INDEFINITE BINARY QUADRATIC FORMS

Keywords:

be the class number of indefinite binary quadratic forms of discriminant d, and let ε d be the corresponding fundamental unit. In this paper, we obtain an asymptotic formula for the k-th moment of h(d) over positive discriminants d with ε d ≤ x, uniformly for real numbers k in the range 0 < k ≤ (log x) 1-o(1) . This improves upon the work of Raulf, who obtained such an asymptotic for a fixed positive integer k. We also investigate the distribution of large values of h(d) when the d's are ordered according to the size of their fundamental units ε d . In particular, we show that the tail of this distribution has the same shape as that of class numbers of imaginary quadratic fields ordered by the size of their discriminants. As an application of these results, we prove that there are many positive discriminants d with class number h(d) ≥ (e γ /3 + o(1)) • ε d (log log ε d )/ log ε d , a bound that we believe is best possible. We also obtain an upper bound for h(d) that is twice as large, assuming the generalized Riemann hypothesis.

Introduction

Let D = {d ∈ N : d ≡ 0 or 1 (mod 4), and d is not a square} be the set of positive discriminants. For d ∈ D let h(d) be the number of equivalence classes of primitive indefinite binary quadratic forms ax 2 +bxy+cy 2 of discriminant d = b 2 -4ac. The study of the class numbers h(d) is an important problem in number theory, and its rich history goes back to the work of Gauss. In particular, in his Disquistiones Arithmeticae, Gauss conjectured that there are infinitely many d ∈ D for which h(d) = 1, a problem that is still open. The difference between this case and the easier one of positive definite forms (which corresponds to negative discriminants) is the role played by the fundamental unit ε d when d > 0. Recall that ε d = (t d + u d √ d)/2, where t d and u d are the smallest positive integer solutions to the Pell equation t 2 -du 2 = 4. Indeed for d ∈ D, Dirichlet's class number formula asserts that (1.1)

h(d) = √ d • L(1, χ d ) log ε d ,
where χ d = d

• is the Kronecker symbol, and L(s, χ d ) is the Dirichlet L-function associated to χ d . Gauss [START_REF] Gauss | Disquistiones Arithmeticae[END_REF] asserted without proof that

d∈D d≤x h(d) log ε d ∼ π 2 18ζ(3)
x 3/2 , an asymptotic formula that was later proved by Siegel [START_REF] Siegel | The average measure of quadratic forms with given determinant and signature[END_REF]. However, Gauss also observed that unlike the quantity h(d) log ε d , the class number h(d) appears to behave rather erratically on average. In fact, for almost two centuries following Gauss's Disquistiones Arithmeticae no asymptotic formula was proposed, let alone proved, for the average of h(d) over d, until Hooley [START_REF] Hooley | On the Pellian equation and the class number of indefinite binary quadratic forms[END_REF] formulated a conjecture for this average. Using a refined analysis of the behaviour of the fundamental units ε d , Hooley [START_REF] Hooley | On the Pellian equation and the class number of indefinite binary quadratic forms[END_REF] conjectured that

d∈D d≤x h(d) ∼ 25 12π 2 x(log x) 2 .
Proving such an asymptotic appears to be one of the most difficult problems in this theory. The main difficulty comes from the erratic behaviour of the fundamental unit ε d which can be as small as √ d but might as well be as large as exp( √ d). A few years prior to Hooley's work, Sarnak [START_REF] Sarnak | Class numbers of indefinite binary quadratic forms[END_REF] observed that this problem can be solved if one orders the discriminants d instead by the size of their fundamental units ε d . This ordering makes the problem easier, since we are favouring those d with small ε d . Using the Selberg trace formula, Sarnak proved that d∈D ε d ≤x h(d) = Li(x 2 ) + O x 3/2+ , and he also showed that (1.2)

d∈D ε d ≤x 1 ∼ 35 16 x,
and hence it follows that the average order of h(d) over the discriminants d ∈ D with ε d ≤ x equals 8x/(35 log x).

Based on a subsequent work of Sarnak [START_REF] Sarnak | Class numbers of indefinite binary quadratic forms II[END_REF], Raulf [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF] obtained a similar asymptotic for the average of h(d) over fundamental discriminants d. Her approach avoids the use of the Selberg trace formula at the cost of a weaker error term. Later in [START_REF] Raulf | Limit distribution of class numbers for discriminants in progressions and fundamental discriminants[END_REF], Raulf generalized her method to obtain an asymptotic formula for the k-th moment of h(d), for any fixed natural number k. We improve on this result, by obtaining an asymptotic formula for the k-th moment of h(d) over positive discriminants d with ε d ≤ x, uniformly for all real numbers k in the range 0 < k ≤ (log x) 1-o(1) . Our approach is different, and relies on the methods of Granville and Soundararajan [START_REF] Granville | The distribution of values of L(1, χ d )[END_REF] and the author ( [START_REF] Lamzouri | Distribution of values of L-functions at the edge of the critical strip[END_REF] and [START_REF] Lamzouri | Extreme values of arg L(1, χ)[END_REF]) for computing large moments of L(1, χ d ). Here and throughout we let log j be the j-fold iterated logarithm; that is, log 2 = log log, log 3 = log log log and so on.

Theorem 1.1. Let x be large. There exists a positive constant B such that uniformly for all real numbers k with 0 < k ≤ log x/(B log 2 x log 3 x) we have

d∈D ε d ≤x h(d) k = H(k) • x 2 t log t k dt + O x k+1 (log x) k exp - log x 200 log 2 x ,
where the constant H(k) is defined in (4.1) below. Moreover, we have

H(k) = p H p (k),
where

H 2 (k) = 1 2 + O 2 k
3 k , and for p ≥ 3 we have

H p (k) = 1 2 - 3 2p 1 - 1 p -k + 1 2 - 1 2p 1 + 1 p -k + 2 p 1 + O 1 (p -1) k . Note that x 2 t log t k dt = x k+1 (k + 1)(log x) k 1 + O 1 log x ,
uniformly in k > 0, and hence we deduce the following corollary.

Corollary 1.2. Let x be large. There exists a positive constant B such that uniformly for all real numbers k with 0 < k ≤ log x/(B log 2 x log 3 x) we have

d∈D ε d ≤x h(d) k = H(k) k + 1 • x k+1 (log x) k 1 + O 1 log x .
One can obtain similar results for the corresponding moments of class numbers over fundamental discriminants, by using the techniques of this paper together with [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF]. Note that when d is fundamental, h(d) is the narrow class number of the real quadratic field Q( √ d), which equals the class number of Q( √ d) if the negative Pell equation t 2 -du 2 = -4 is solvable, and equals twice this class number if the negative Pell equation is not solvable. Hence, in order to translate our results to the setting of real quadratic fields, one needs to understand the difficult problem of the distribution of discriminants d for which the negative Pell equation is solvable (see [START_REF] Fouvry | On the negative Pell equation[END_REF] for a reference on this problem).

As an application of Theorem 1.1 we investigate large values of h(d) and their distribution, when the discriminants d are ordered according to the size of their fundamental units. We remark here that this ordering causes the class numbers h(d) to be distributed very differently than if one orders the d's naturally according to their size. Indeed, note that the class number h(d) is expected to be typically of size log ε d if we order by the size of d, while Theorem 1.1 shows that h(d) is typically of size ε d / log ε d when we order the d's by the size of ε d . This is due to the fact that this latter order favours those discriminants d with small fundamental units ε d .

It follows from the work of Littlewood [START_REF] Littlewood | On the class number of the corpus P ( √ -k)[END_REF] that assuming the generalized Riemann hypothesis GRH one can approximate L(1, χ d ) by a short Euler product over the primes p ≤ (log d) 2+o (1) . More precisely, assuming GRH one has (see Lemma 2.1 of [START_REF] Granville | The distribution of values of L(1, χ d )[END_REF])

(1.3) L(1, χ d ) = p≤(log d) 2 1 - χ d (p) p -1 1 + O log 3 d log 2 d .
Moreover, Littlewood [START_REF] Littlewood | On the class number of the corpus P ( √ -k)[END_REF] conjectured that the shorter Euler product over the primes p ≤ log d still serves as a good approximation for L(1, χ d ). More precisely we have Conjecture 1.3 (Littlewood).

L(1, χ d ) ∼ p≤log d 1 - χ d (p) p -1
.

In [START_REF] Granville | The distribution of values of L(1, χ d )[END_REF]

h(d) ≤        2e γ 3 + o(1) ε d log log ε d log ε d assuming GRH, e γ 3 + o(1) ε d log log ε d log ε d assuming Conjecture 1.3.
It follows from Theorem 1.1 that h(d)(log ε d )/ε d has a limiting distribution as ε d → ∞. This also follows from the results of [START_REF] Raulf | Limit distribution of class numbers for discriminants in progressions and fundamental discriminants[END_REF]. This distribution function is difficult to compute, due to complicated nature of its moments (see (4.1) below). Nevertheless, using the saddle-point method, we are able to obtain a precise estimate for its large deviations. More specifically, using Theorem 1.1 we show, in a large uniform range, that the tail of this distribution has the same shape as that of class numbers of imaginary quadratic fields ordered by the size of their discriminants, which was derived by Granville and Soundararajan [START_REF] Granville | The distribution of values of L(1, χ d )[END_REF]. As a consequence, we prove that the second bound in Theorem 1.4 is best possible, and is attained for many discriminants d ∈ D with ε d ≤ x. Theorem 1.5. Let x be large. There exists a positive constant C, such that uniformly in the range 1 τ ≤ log 2 x-log 3 x-log 4 x-C, the proportion of positive discriminants d with ε d ≤ x and such that

h(d) ≥ e γ 3 x log x • τ, equals (1.5) exp - e τ -A 0 τ 1 + O 1 √ τ ,
where

(1.6) A 0 := 1 0 log cosh(t) t 2 dt + ∞ 1 log cosh(t) -t t 2 dt + 1 = 0.8187 • • • .
Corollary 1.6. There are at least

x 1-1/ log log x discriminants d ∈ D with ε d ≤ x such that h(d) ≥ e γ 3 + o(1) ε d log log ε d log ε d .
The paper is organized as follows. In Section 2, we prove the conditional result Theorem 1.4. In Section 3, we establish an asymptotic formula for the sum ε d ≤x χ d (m)d k/2 . This will be one of the main ingredients to compute the moments of h(d) and prove Theorem 1.1, which shall be completed in Section 4. In Section 5, we investigate the distribution of large values of h(d) and prove Theorem 1.5.

A conditional bound for the class number in terms of the fundamental unit: proof of Theorem 1.4

We shall only establish the first bound under GRH, since the second can be obtained along the same lines by assuming Conjecture 1.3 and replacing (log d) 2 by log d in the argument below.

Assume GRH and let d be a large positive discriminant. Then, it follows from (1.3) that

L(1, χ d ) ≤ (1 + o(1)) 1 - χ d (2) 2 -1 1 - χ d (3) 3 -1 5≤p≤(log d) 2 1 - 1 p -1 ≤ 2e γ 3 + o(1) 1 - χ d (2) 2 -1 1 - χ d (3) 3 -1 log log d. Let ε d = (t d + u d √ d)/2. Since t 2 d = u 2 d d + 4, then one has √ d ≤ ε d /u d .
Thus, from the class number formula (1.1) we derive, assuming GRH

h(d) ≤ 2e γ 3 + o(1) ε d log log ε d log ε d • E(d),
where

E(d) = 1 u d 1 - χ d (2) 2 -1 1 - χ d (3) 3 -1 .
To complete the proof, we will show that for all d ∈ D we have

E(d) ≤ 1. First, if u d = 1 then d = t 2 d -4 ≡ 1 (mod 8) and d ≡ 1 (mod 3). Therefore we have χ d (2), χ d (3) ∈ {-1, 0} and thus E(d) ≤ 1 in this case. Next, if u d = 2 then t d = 2m
is even and we deduce that d = m 2 -1. Then, similarly to the previous case, one has d ≡ 1 (mod 8) and d ≡ 1 (mod 3), and hence

E(d) ≤ 1. Finally if u d ≥ 3 then E(d) ≤ 1 3 1 - 1 2 -1 1 - 1 3 -1 = 1,
as desired.

3. An asymptotic formula for the sum

ε d ≤x χ d (m)d k/2
The purpose of this section is to prove the following result, which is one of the main ingredients to compute the moments of class numbers of indefinite binary quadratic forms.

Theorem 3.1. Let m be a positive integer. Then, for any real number 0 < k ≤ log x/ log 2 x we have

d∈D ε d ≤x χ d (m)d k/2 = C(k) k + 1 • g k (m) • x k+1 + O m • x k+49/50
, where

(3.1) C(k) := 1 + 1 2 k+2 + 2 4 k+2 + 4 4 k+2 (2 k+2 -1) p>2 1 + 2 p k+2 -1 ,
and g k (m) is the multiplicative function defined by

g k (2 a ) := (-1) a 2 1 + 2 (1 + (-1) a ) 4 k+2 (2 k+2 -1) 1 + 1 2 k+2 + 2 4 k+2 + 4 4 k+2 (2 k+2 -1) -1 for a ≥ 1,
and for p > 2 and a ≥ 1 we have

g k (p a ) :=    -1 p 1 + 2 p k+2 -1 -1 if a is odd, 1 -2 p 1 + 2(p-1) (p-2)(p k+2 -1) 1 + 2 p k+2 -1 -1 if a is even. Our starting point is a parametrization of the set of discriminants d ∈ D such that ε d ≤ x. If d is such a discriminant and ε d = (t + u √ d)/2 is its fundamental unit, then d = (t 2 -4)/u 2 .
We shall prove that summing over d ∈ D such that ε d ≤ x amounts to essentially summing over the corresponding pairs (t, u) in a certain range. This follows from the arguments in [START_REF] Sarnak | Class numbers of indefinite binary quadratic forms[END_REF] and was used by Raulf [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF] to compute the first moment of class numbers over fundamental discriminants. Here and throughout we define

d(t, u) := t 2 -4 u 2 , for t, u ∈ N.

Then we have

Lemma 3.2. Let x > 0 be large. There is a one-to-one correspondence between the pairs (d, n) such that d ∈ D and ε n d ≤ x, and the pairs of positive integers (t, u) such that 2 < t ≤ X and d(t, u) ∈ D, where X is the unique solution to the equation

(3.2) X + √ X 2 -4 2 = x.
Moreover, the relation between a pair (d, n) and its corresponding pair (t, u) is given by

ε n d = t + u √ d 2 .
Proof. First, let (t, u) be such that 2 < t ≤ X and d(t, u) ∈ D. Hence (t, u) is a solution to Pell's equation t 2 -u 2 d = 4, with d = d(t, u). Therefore, it follows from the theory of Pell's equation that there exists a positive integer n such that

ε n d = t + u √ d 2 = t + √ t 2 -4 2 ≤ x, since 2 < t ≤ X. On the other hand, if (d, n) is such that d ∈ D and ε n d ≤ x, then ε n d = (t + u √ d)/2 where (t, u) is a solution to Pell's equation t 2 -u 2 d = 4. Thus, for this pair (t, u) we have d(t, u) = d ∈ D and 2 < t ≤ X since ε n d = (t + √ t 2 -4)/2 ≤ x, as desired. Let d ∈ D and ε d = (t + u √ d)/2 be its fundamental unit, so that d = d(t, u). If t ≡ a (mod 4u 2 ) then t = a + 4u 2 and hence d = 16u 2 2 + 8a + d(a, u) for some ∈ N. Therefore, one has χ d (m) = Pa,u( ) m
, where P a,u is the quadratic polynomial defined by

(3.3) P a,u ( ) := 16u 2 2 + 8a + d(a, u).
One of the key ingredients in the proof of Theorem 3.1 is the evaluation of the following complete character sum

C m (P a,u ) := m-1 =0 P a,u ( ) m .
Lemma 3.3. Let a, u be positive integers such that d(a, u) ∈ D. Let m be a positive integer and write m = 2 e 1 p e 2 2 • • • p er r , where e 1 ≥ 0 and e j ≥ 1 for 2 ≤ j ≤ r. Also, let m 0 be the squarefree part of m/2 e 1 . Then, if (m 0 , u) > 1 we have C m (P a,u ) = 0. Moreover, if (m 0 , u) = 1 then we have

C m (P a,u ) m = b a,u (m) (-1) ω(m 0 ) m 0 2≤j≤r e j is even 1 - 2 p j p j |u e j is even 1 + 1 p j -2 ,
where ω(m 0 ) is the number of prime factors of m 0 , and b a,u (m) = 1 if m is odd, and if m is even we have

b a,u (m) =      0 if d(a, u) ≡ 0 (mod 4) 1 if d(a, u) ≡ 1 (mod 8) (-1) e 1 if d(a, u) ≡ 5 (mod 8). Proof. Since C m (P a,u ) is a complete character sum then C m (P a,u ) = 1 mod 2 e 1 P a,u ( 1 ) 2 e 1 r j=2    j mod p e j j P a,u ( j ) p e j j    .
First, since P a,u ( ) ≡ d(a, u) (mod 8) for all , then we obtain

1 mod 2 e 1 P a,u ( 1 ) 2 e 1 = 2 e 1 d(a, u) 2 e 1 = 2 e 1 b a,u (m), if e 1 ≥ 1.
This equality is also valid if e 1 = 0. On the other hand, for 2 ≤ j ≤ r we have j mod p e j j P a,u ( j ) p e j j = j mod p e j j P a,u ( j ) p j e j .

Since every ∈ {1, 2, . . . , p e } can be written in the form i = b+np with b ∈ {1, 2, . . . , p} and n ∈ {0, 1, . . . , p e-1 -1} we deduce that for all 2 ≤ j ≤ r, we have

j mod p e j j P a,u ( j ) p j e j = p e j -1 j b j mod p j P a,u (b j ) p j e j
. Now, it follows from Lemma 2.14 of [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF] that if e j is even we have

b j mod p j P a,u (b j ) p j e j = p j -2 if p j u p j -1 if p j | u,
while if e j is odd we have

b j mod p j P a,u (b j ) p j e j = -1 if p j u 0 if p j | u,
Combining these estimates completes the proof.

Note that when m is even, the value of the character sum C m (P a,u ) depends on whether d(a, u) ≡ 0 (mod 4) or d(a, u) ≡ 1, 5 (mod 8). Before completing the proof of Theorem 3.1 we need the following Lemma which is a special case of Lemma 3.1 of [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF].

N i (u) := |{2 < a ≤ 4u 2 + 2 : d(a, u) ∈ D i }|.
Then, writing u = 2 r 1 u 0 , where r 1 ≥ 0 and u 0 is odd, we obtain

N 0 (u) =      2 • 2 η(u) if r 1 = 0, 4 • 2 η(u) if r 1 = 1, 8 • 2 η(u) if r 1 ≥ 2, N 1 (u) = 4 • 2 η(u) if r 1 ≥ 3, 0 otherwise,
and

N 2 (u) =      2 • 2 η(u) if r 1 = 0, 4 • 2 η(u) if r 1 ≥ 3, 0 otherwise,
where η(u) = |{p ≥ 3 : p|u}|.

We now have the necessary ingredients to complete the proof of Theorem 3.1.

Proof of Theorem 3.1. First, by Lemma 3.2 we have

d∈D n≥1 ε n d ≤x χ d (m)d k/2 = u≥1 2<t≤X d(t,u)∈D d(t, u) m d(t, u) k/2 .
Moreover, it follows from Lemma 2.1 of [START_REF] Raulf | Asymptotics of class numbers for progressions and for fundamental discriminants[END_REF] that

(3.4) {(t, u) : u > x δ , 2 < t ≤ x, and d(t, u) ∈ D} x 1-δ/5 ,
for any 0 < δ < 1/2. Choosing δ = 1/10 and noting that d(t, u) ≤ t 2 /u 2 ≤ x 2(1-1/10) and X = x + O(1/x) we obtain

d∈D n≥1 ε n d ≤x χ d (m)d k/2 = u≤x 1/10 2<t≤x d(t,u)∈D d(t, u) m d(t, u) k/2 + O x 9k/10+49/50 .
On the other hand, since d ≤ ε 2 d one has

d∈D n≥2 ε n d ≤x χ d (m)d k/2 x k/2
S u (x) = 2<a≤4u 2 +2 d(a,u)∈D 0≤ ≤ x-a 4u 2 P a,u ( ) m P a,u ( ) k/2 ,
where P a,u ( ) is defined in (3.3) above. For any integers ≥ 1 and 2 < a ≤ 4u 2 + 2 we have P a,u ( ) = 16u 2 2 + O(u 2 ), and hence P a,u ( ) k/2 = (4u

) k + O k(4u) k k-1 if k = o( ).
Therefore, we obtain (3.7) 1) . The inner sum can be computed from the sum ≤y Pa,u( ) m using partial summation. Now observe that for a real number y ≥ 2 we have

S u (x) = 2<a≤4u 2 +2 d(a,u)∈D √ x≤ ≤ x-a 4u 2 P a,u ( ) m P a,u ( ) k/2 + O 4 k u k+2 x (k+1)/2 = (4u) k 2<a≤4u 2 +2 d(a,u)∈D √ x≤ ≤ x-a 4u 2 P a,u ( ) m k + O u 2-k x k+1/2 , since k > 0 and 4 k = x o(
≤y P a,u ( ) m = y m m-1 =0 P a,u ( ) m + O (m) = C m (P a,u ) m • y + O(m).
Therefore, by partial summation we deduce that (3.8)

√ x≤ ≤ x-a 4u 2 P a,u ( ) m k = 1 (k + 1) x -a 4u 2 k+1 C m (P a,u ) m + O x (k+1)/2 + m x 4u 2 k = 1 (k + 1) x 4u 2 k+1 C m (P a,u ) m + O x (k+1)/2 + m x 4u 2 k , since |C m (P a,u )| ≤ m and x -a 4u 2 k+1 = x 4u 2 + O(1) k+1 = x 4u 2 k+1 1 + O (k + 1)u 2 x .
Thus, inserting the estimate (3.8) in (3.7) we deduce that

S u (x) = x k+1 4(k + 1)u k+2 2<a≤4u 2 +2 d(a,u)∈D C m (P a,u ) m + O m • u 2-k x k+1/2 . Write m = 2 e 1 p e 2 2 • • • p en n
, where e 1 ≥ 0 and e j ≥ 1 for 2 ≤ j ≤ n, and let m 0 be the squarefree part of m/2 e 1 . Then, it follows from Lemma 3.3 that C m (P a,u ) = 0 only when (u, m 0 ) = 1, and in this case we have

2<a≤4u 2 +2 d(a,u)∈D C m (P a,u ) m = (-1) ω(m 0 ) m 0 2≤j≤n e j is even 1 - 2 p j p j |u e j is even 1 + 1 p j -2 2<a≤4u 2 +2 d(a,u)∈D b a,u (m). Let B m (u) := 2<a≤4u 2 +2 d(a,u)∈D b a,u (m).
Write u = 2 r 1 u 0 , where r 1 ≥ 0 and u 0 is odd. We shall distinguish two cases according to Lemma 3.3. First, if e 1 = 0 then b a,u (m) = 1 and hence by Lemma 3.4 we obtain that

B m (u) = N 0 (u) + N 1 (u) + N 2 (u) =      4 • 2 η(u) if r 1 = 0 or 1, 8 • 2 η(u) if r 1 = 2, 16 • 2 η(u) if r 1 ≥ 3.
On the other hand, if e 1 ≥ 1 then we have

B m (u) = N 1 (u) + (-1) e 1 N 2 (u) =      2(-1) e 1 2 η(u) if r 1 = 0, 4 1 + (-1) e 1 2 η(u) if r 1 ≥ 3, 0 otherwise.
Furthermore, we define

F m (u) := B m (u) a(m) p j |u e j is even 1 + 1 p j -2
where a(m) := 4 if m is odd, 2(-1) e 1 if m is even.

Then, one can observe that B m (u)/a(m) = 2 η(u) if u is odd, and hence it follows that for any fixed m, the function F m (u) is multiplicative in u, and F m (u) m • d(u), where d(u) = |u 1 is the divisor function.

Combining these estimates with (3.5) and (3.6) we deduce that

d∈D ε d ≤x χ d (m)d k/2 = (-1) ω(m 0 ) a(m) 4m 0 2≤j≤n e j is even 1 - 2 p j x k+1 (k + 1) u≤x 1/10 (u,m 0 )=1 F m (u) u k+2 + O m • x k+49/50 .
Moreover, we have

u≤x 1/10 (u,m 0 )=1 F m (u) u k+2 = u≥1 (u,m 0 )=1 F m (u) u k+2 +O   m u>x 1/10 d(u) u 2   = u≥1 (u,m 0 )=1 F m (u) u k+2 +O m log x x 1/10 . Now, using that F m (u) is multiplicative, we obtain u≥1 (u,m 0 )=1 F m (u) u k+2 = ∞ a=0 F m (2 a ) 2 a(k+2) 2≤j≤n e j is even ∞ a=0 F m (p a j ) p a(k+2) j p 2m ∞ a=0 F m (p a ) p a(k+2) = ∞ a=0 F m (2 a ) 2 a(k+2) 2≤j≤n e j is even   1 + ∞ a=1 2 1 + 1 p j -2 p a(k+2) j   p 2m 1 + ∞ a=1 2 p a(k+2) = ∞ a=0 F m (2 a ) 2 a(k+2) 2≤j≤n e j is even 1 + 2(p j -1) (p j -2)(p k+2 j -1) p 2m 1 + 2 p k+2 -1 .
The first factor ∞ a=0 F m (2 a )/2 a(k+2) depends on whether m is even or odd. Indeed, in the first case (which corresponds to e 1 ≥ 1) we have

∞ a=0 F m (2 a ) 2 a(k+2) = 1 + 2 (1 + (-1) e 1 ) ∞ a=3 1 2 a(k+2) = 1 + 2 (1 + (-1) e 1 ) 4 k+2 (2 k+2 -1)
.

On the other hand, if m is odd (that is e 1 = 0) then

∞ a=0 F m (2 a ) 2 a(k+2) = 1 + 1 2 k+2 + 2 4 k+2 + 4 a=3 1 2 a(k+2) = 1 + 1 2 k+2 + 2 4 k+2 + 4 4 k+2 (2 k+2 -1)
.

Combining these estimates completes the proof.

H(k) := C(k) • ∞ m=1 d k (m)g k (m) m ,
where C(k) and g k are defined in Theorem 3.1. Note that H(k) = p H p (k), where

(4.2) H p (k) = 1 + O 1 p k+2 ∞ a=0 d k (p a )g k (p a )
p a , by (3.1). We begin by proving the estimates for H p (k) that are stated in Theorem 1.1.

Lemma 4.1. Let k be a large positive real number. Then we have

H 2 (k) = 1 2 + O 2 k 3 k ,
and for p ≥ 3,

H p (k) = 1 2 - 3 2p 1 - 1 p -k + 1 2 - 1 2p 1 + 1 p -k + 2 p 1 + O 1 (p -1) k .
Proof. Observe that for any prime p, and real numbers k and t such that |t| < p we have

(4.3) ∞ a=0 d k (p a )t a p a = 1 - t p -k
.

We first consider the case p = 2. In this case we have

∞ a=0 d k (2 a )g k (2 a ) 2 a = 1 + ∞ a=1 d k (2 a ) 2 a (-1) a 2 + O 1 2 k = 1 + 1 2 + O 1 2 k ∞ a=0 d k (2 a )(-1) a 2 a -1 = 1 2 + O 2 k 3 k . Next, if p > 2 then ∞ a=0 g k (p a )d k (p a ) p a = 1 - 1 p a≥1 a odd d k (p a ) p a + 1 - 2 p a≥1 a even d k (p a ) p a + O 1 p k ∞ a=1 d k (p a ) p a = 1 - 1 p ∞ a=1 d k (p a ) p a 1 -(-1) a 2 + 1 - 2 p ∞ a=1 d k (p a ) p a 1 + (-1) a 2 + O 1 (p -1) k = 1 2 - 3 2p 1 - 1 p -k + 1 2 - 1 2p 1 + 1 p -k + 2 p + O 1 (p -1) k ,

by (4.3). The lemma follows upon combining these estimates with (4.2).

Let k be a positive real number. By the class number formula (1.1) we have

d∈D ε d ≤x h(d) k = d∈D ε d ≤x L(1, χ d ) k d k/2 (log ε d ) k .
Hence, in order to find an asymptotic formula for this moment it suffices to estimate the sum

ε d ≤x L(1, χ d ) k d k/2
. Indeed, an easy application of partial summation together with the following result imply Theorem 1.1.

Theorem 4.2. Let x be large. There exists a positive constant B such that uniformly for all real numbers k with 0 < k ≤ log x/(B log 2 x log 3 x) we have

d∈D ε d ≤x L(1, χ d ) k d k/2 = H(k) k + 1 • x k+1 + O x k+1 exp - log x 150 log 2 x .
For any k ∈ R, and Re(s) > 1 we have

L(s, χ d ) k = ∞ n=1 d k (n) n χ d (n).
We now recall some standard bounds for the divisor function Proof. First, by Lemma 3.2 we have

d k (n). We have |d k (n)| ≤ d |k| (n) ≤ d (n)
L(1, χ d ) k = ∞ n=1 d k (n)χ d (n) n e -n/y + O exp - log y 2 log 2 d .
|{(d, n) : d ∈ D, n ∈ N, ε n d ≤ x and L(s, χ d ) has a zero in R(x)}| = {(t, u) : u ∈ N, 2 < t < X and L(s, χ d(t,u) ) has a zero in R(x)} .
The contribution of the pairs (d, n) such that n ≥ 2, d ∈ D and ε n d ≤ x is negligible. Indeed, we have

d∈D n≥2 ε n d ≤x 1 = 2≤n log x d∈D ε d ≤x 1/n 1 x 1 2 log x, by (1.2)
. Hence, combining this bound with (3.4) we deduce that

|{d ∈ D : ε d ≤ x and L(s, χ d ) has a zero in R(x)}| = {(t, u) : u ≤ x δ , 2 < t < x and L(s, χ d(t,u) ) has a zero in R(x)} + O x 1-δ/5 .
In order to bound the number of pairs (t, u) for which L(s, χ d(t,u) ) has a zero in R(x), we shall use the following zero-density result of Heath-Brown [START_REF] Heath-Brown | A mean value estimate for real character sums[END_REF], which states that for 1/2 < σ < 1 and any > 0 we have

(4.6) |d|≤x N (σ, T, χ d ) (xT ) x 3(1-σ)/(2-σ) T (3-2σ)/(2-σ) ,
where L(s,χ d(t,u) ) has a zero in R(x) then d(t, u) ≤ x 2 and hence there exists a unique j ∈ {1, 2, . . . , M } such that d(t, u) = d j • 2 for some ∈ N. This implies that t 2 -4 = d j u 2 2 , which shows that (t, ) is a solution to Pell's equation x 2 -d j u 2 y 2 = 4, and therefore we must have

t + d j u 2 = ε n d j u 2 , for some n ∈ N,
where ε d j u 2 is the fundamental unit associated to the discriminant d j u 2 . Since ε n d j u 2 ≤ t we obtain that |{(t, ) : 2 < t ≤ x, ≥ 1, and

t 2 -4 = d j u 2 2 }| ≤ |{n ∈ N : ε n d j u 2 ≤ x} log x.
Thus, we deduce that |{d ∈ D : ε d ≤ x and L(s, χ d ) has a zero in R(x)}| x δ M log x + x 1-δ 5 .

Choosing δ = 1/4 and using the bound (4.7) completes the proof.

We are now ready to prove Theorem 4.2.

Proof of Theorem 4. Therefore, using this bound together with (4.8) we obtain

d∈D ε d ≤x L(1, χ d ) k d k/2 = d∈ D(x) L(1, χ d ) k d k/2 + O x k+1-
d∈D ε d ≤x L(1, χ d ) k d k/2 = ∞ n=1 d k (n) n e -n/y d∈ D(x) χ d (n)d k/2 + O x k+1 exp - log x 150 log 2 x .
We now extend the main term of the last estimate, so as to include all discriminants d ∈ D with ε d ≤ x. Using (4.5) and (4.9), we deduce that

∞ n=1 d k (n) n e -n/y    d∈D ε d ≤x χ d (n)d k/2 - d∈ D(x) χ d (n)d k/2    x k+1-1/20 ∞ n=1 d (n) n e -n/y x k+1-1/30 .
Combining this bound with Theorem 3.1 we obtain (4.10)

d∈D ε d ≤x L(1, χ d ) k d k/2 = C(k) k + 1 • x k+1 • ∞ n=1 d k (n)g k (n) n e -n/y + O x k+1-
d∈D ε d ≤x L(1, χ d ) k d k/2 = H(k) k + 1 • x k+1 + O E k (x) + x k+1 exp - log x 150 log 2 x
, where

E k (x) = x k+1 • ∞ n=1 d k (n)|g k (n)| n 1 -e -n/y .
A simple computation together with the definition of g k (p) shows that for every real number k > 0 we have |g k (2 a )| ≤ 1/2 for all a ≥ 1, and for p > 2 and a ≥ 1 we have

|g k (p a )| ≤ 1 p if a is odd, 1 if a is even.
Thus, it follows that for every real number k > 0 and positive integer n we have |g k (n)| ≤ 1/n 0 where n 0 is the squarefree part of n. Next, note that 1 -e -n/y (n/y) α for all real numbers 0 < α ≤ 1. Choosing α = 1/ log log x, and writing n = n 0 n 2 1 we deduce that

E k (x) y -α x k+1 ∞ n=1 d (n) n 0 n 1-α y -α x k+1 ∞ n 0 =1 d (n 0 ) n 2-α 0 ∞ n 1 =1 d 2 (n 1 ) n 2-2α 1 = y -α x k+1 ζ(2 -α) ∞ n=1 d 2 (n) n 2-2α , since d (n 0 n 2 1 ) ≤ d (n 0 )d (n 2 1 ) ≤ d (n 0 )d (n 1 ) 2 .
Finally, we use the following bound, which follows from Lemma 3.

3 of [8] ∞ n=1 d 2 (n) n 2-2α ≤ exp 2 + o(1) log 2 .
This shows that E k (x)

x k+1 exp (-log x/(100 log 2 x)) , which completes the proof.

The distribution of large values of h(d):

Proof of Theorem 1.5

In order to use Theorem 1.1 to study the distribution of large values of h(d), we first need to estimate the constant H(k) when k is large. We prove Proposition 5.1. Let k be a large positive real number. Then we have

log H(k) = k log log k + k(γ -log 3) + (A 0 -1) k log k + O k (log k) 2 ,
where A 0 is defined in Theorem 1.5.

Recall that H(k) = p H p (k). Furthermore, it follows from Lemma 4.1 that H 2 (k) = O(1) and H 3 (k) = O(1) for all k > 1. Hence, we only need to estimate H p (k) for primes p ≥ 5.

Lemma 5.2. Let k be a large positive real number, and p be a prime number. Then we have

log H p (k) =    -k • log 1 -1 p + O(1) if 5 ≤ p ≤ k 2/3 , log cosh k p + O k p 2 if p > k 2/3 . Proof. First, if 5 ≤ p ≤ k 2/3 then it follows from Lemma 4.1 that H p (k) = 1 2 - 3 2p 1 - 1 p -k 1 + O exp -k 1/3 .
Taking the logarithm of both sides implies the desired estimate in this case. Now, if p > k 2/3 then by Lemma 4.1 we have

H p (k) = 1 2 - 3 2p e k/p + 1 2 - 1 2p e -k/p + 2 p 1 + O k p 2 = 1 - 3 p cosh k p + 1 p e -k/p + 2 p 1 + O k p 2 = cosh k p 1 + O k p 2 ,
since cosh(t) -1 ≤ sinh(t) t cosh(t) for t > 0. This completes the proof.

Define

f (t) := log cosh(t) if 0 ≤ t < 1, log cosh(t) -t if t ≥ 1.
Then, we have (5.1)

f (t) := t 2 /2 + O(t 4 ) if 0 ≤ t < 1, O(1) if t ≥ 1.
We are now ready to prove Proposition 5.1. Define κ := e τ -A 0 so that τ = log κ + A 0 . Also, let K = κe δ where δ > 0 is a small parameter to be chosen later. Then, it follows from (5.5) that Furthermore, since N x (t) is non-increasing as a function of t we can bound the above integral as follows

τ κ exp O δκ τ N x (τ + δ) ≤ τ +δ τ -δ t κ-1 N x (t)dt ≤ τ κ exp O δκ τ N x (τ -δ).
Inserting these bounds in (5.6), and using the definition of κ we obtain

N x (τ + δ) ≤ exp - e τ -A 0 τ (1 + O (δ)) ≤ N x (τ -δ),
and thus

N x (τ ) = exp - e τ -A 0 τ 1 + O 1 √ τ .
as desired.

Lemma 3 . 4 (

 34 Lemma 3.1 of [11]). Let D 0 = {d ∈ D : d ≡ 0 (mod 4)}, D 1 = {d ∈ D : d ≡ 1 (mod 8)} and D 2 = {d ∈ D : d ≡ 5 (mod 8)}. Moreover, for i = 0, 1, 2, and a positive integer u we define

4 . 1

 41 Moments of the class number: Proof of Theorem 1.We shall first define the constant H(k) that appears in the asymptotic formula of Theorem 1.1. For k ∈ R, let d k (m) be the k-th divisor function, which is the multiplicative function defined on prime powers by d k (p a ) = Γ(k + a)/(Γ(k)a!). Then define (4.1)

  for any integer ≥ |k|, and d (mn) ≤ d (m)d (n) for any positive integers , m, n. Furthermore for ∈ N, and y > 3 we have that (4.4) d (n)e -n/y ≤ e /y a 1 ...a =n e -(a 1 +...+a )/y , One of the key ingredients in the proof of Theorem 4.2 is an approximation of L(1, χ d ) k by (essentially) a very short Dirichlet polynomial if L(s, χ d ) has no zeros in a small region to the left of the line Re(s) = 1. This was proved in Proposition 3.3 of [1]. Proposition 4.3 (Proposition 3.3 of [1]). Let d be a large positive discriminant and 0 < < 1/2 be fixed. Let y be a real number such that log d/ log 2 d ≤ log y ≤ log d. Furthermore, assume that L(s, χ d ) has no zeros inside the rectangle {s : 1 -< Re(s) ≤ 1 and |Im(s)| ≤ 2(log d) 2/ }. Then for any positive real number k such that k ≤ log y/(4 log 2 d log 3 d) we have

  Our last ingredient is a bound on the number of discriminants d ∈ D with ε d ≤ x and such that L(s, χ d ) has a zero in the rectangle R(x) := s ∈ C : 9/10 < Re(s) < 1 and |Im(s)| ≤ (log x) 40 . Lemma 4.4. There are at most O(x 1-1/20 ) discriminants d ∈ D such that ε d ≤ x and L(s, χ d ) has a zero in the rectangle R(x).

2 N

 2 N (σ, T, χ d ) is the number of zeros ρ of L(s, χ d ) with Re(ρ) ≥ σ and |Im(ρ)| ≤ T , and indicates that the sum is over fundamental discriminants. Let T = (log x) 40 , and M be the number of positive fundamental discriminants d ≤ x 2 such that L(s, χ d ) has a zero in the rectangle R(x). Then, it follows from (4(9/10, T, χ d ) x 3/5 . Recall that for every discriminant d ∈ D, there exists a unique fundamental discriminant d such that d = d • 2 for some ∈ N. Moreover, the zeros of L(s, χ d ) and those of L(s, χ d ) are the same in the half-plane Re(s) > 0. Let d 1 , • • • , d M be the positive fundamental discriminants d ≤ x 2 for which L(s, χ d ) has a zero in R(x), and fix u ≤ x δ . If 2 < t ≤ x and

2 .

 2 Let d ∈ D such that ε d ≤ x. Then we have d ≤ ε 2 d ≤ x 2 , and thus for any real number k such that 0 < k log x/(log 2 x log 3 x), we have (4.8) L(1, χ d ) k ≤ (c log d) k ≤ (2c log x) k = x o(1) , for some constant c > 0, which follows from the standard bound L(1, χ d ) log d. Let D(x) be the set of discriminants d ∈ D such that d ≥ √ x, ε d ≤ x and L(s, χ d ) does not have a zero in the rectangle R(x). Then, it follows from Lemma 4.4 that (4.9) |{d ∈ D : ε d ≤ x}| -| D(x)| x 1-1/20 .

fu 2 γ 3 x log x • τ. Proof of Theorem 1 . 5 .

 215 (u) u 2 du + O k (log k) 2 ,by a change of variables u = k/t, and since ∞ 0 (f (u)(log u)/u 2 )du < ∞. Extending the integral in the right hand side of this estimate gives(du + O k -1/3 .by(5.1). The result follows upon combining (5.2), (5.3) and (5.4), together with the following estimate which follows from the prime number theorem-5≤p≤k log 1 -1 p = log log k + γ -log 3 + O 1 (log k) 2 .We end this section by proving Theorem 1.5. To shorten our notation, we let D(x) be the set of d ∈ D with ε d ≤ x. We also let N x (τ ) be the proportion of discriminantsd ∈ D(x) such that h(d) ≥e First, observe that for every real number k > 1 we havek k .Therefore, it follows from (1.2) together with Corollary 1.2 and Proposition 5.1 that for 1 k ≤ log x/(B log 2 x log 3 x), we have (5.5)∞ 0 t k-1 N x (t)dt = (log k) k exp k log k A 0 -1 + O 1 log k .

∞ τ +δ t κ- 1 2 .

 12 N x (t)dt ≤ (τ + δ) κ(1-e δ ) ∞ 0 t K-1 N x (t)dt = (τ + δ) κ(1-e δ ) (log κ + δ) κe δ exp κe δ log κ A 0 -1 + O 1 log κ = (log κ) κ exp κ log κ A 0 -1 + (δ + 1 -e δ ) + O 1 log κ , by the definition of κ. Choosing δ = C 0 / √ log k for a suitably large constant C 0 implies ∞ τ +δ t κ-1 N x (t)dt ≤ ∞ 0 t κ-1 N x (t)dt exp -κ log κ 2 .A similar argument shows thatτ -δ 0 t κ-1 N x (t)dt ≤ ∞ 0 t κ-1 N x (t)dt exp -κ log κCombining these bounds with (5.5) gives (5.6)τ +δ τ -δ t κ-1 N x (t)dt = (log κ) κ exp κ log κ A 0 -1 + O 1 log κ .

  1/30 . if k ≤ log x/(B log 2 log 3 x) with a suitably large constant B. Hence, we derive

	Let y = x 1/60 , and = [k] + 1. Then, it follows from Proposition 4.3 that for any
	d ∈ D(x) we have
	L(1, χ d ) k =	∞ n=1	d k (n)χ d (n) n	e -n/y + O exp -	log x 150 log 2 x	,

  To bound the error term in the last estimate, we split the sum ∞ n=1 d (n)e -n/y into two parts: n ≤ y log 2 y and n > y log 2 y. The contribution of the first part is

	≤	n≤y log 2 y	y log 2 y n	d (n)e -n/y ≤ y log 2 y	∞ n=1	d (n) n	e -n/y	y(log 3y) +2	x 1/59 ,
	by (4.5), if x is sufficiently large. The remaining terms contribute
	≤ exp -	(log y) 2 2	∞ n=1	d (n)e -n/(2y) ≤ exp -	(log y) 2 2	e 1/y	∞ a=1	e -a/y
								exp -	(log y) 2 2	(2y)	exp -	(log y) 2 4	,
	by (4.4). Combining these estimates and using that C(k) = O(1) we deduce that
	(4.11)
							1/50	∞ n=1	d (n)e -n/y + x k+1 exp -	log x 150 log 2 x	.

  Proof of Proposition 5.1. First, recall that H 2 (k) = O(1) and H 3 (k) = O(1) for all k > 1, by Lemma 4.1. Therefore, it follows from Lemma 5.2 and equation (5.1) that since f (t) = t 2 /2 + O(t 4 ) for 0 ≤ t < 1. Now, using the prime number theorem in the form π(t) -Li(t) t/(log t)3 , together with partial summation, we obtain(5.3)

	(5.2)	log H(k) = -k = -k	5≤p≤k 2/3 5≤p≤k log 1 -log 1 -1 p	1 p	+	+ k 2/3 <p<k 4/3 log cosh p>k 2/3 f k p	k p + O k 2/3 , + O k 2/3
		k 2/3 <p<k 4/3	f	k p	=	k 4/3 k 2/3	f		k t	dt log t	+ O	k (log k) 2

2≤n log x d∈D ε d ≤x 1/n

Acknowledgements

I would like to thank the anonymous referee for many valuable suggestions which helped strengthen the results of the paper. I would also like to thank Gergely Harcos for a useful comment.

The author is partially supported by a Discovery Grant from the Natural Sciences and Engineering Research Council of Canada.