Let $d>1$ be not a square. Then the continued fraction expansion of $\sqrt d$ is $[a_0; \overline{a_1,\dots,a_\ell}]$, where $a_0=\lfloor \sqrt d\rfloor$ and $a_\ell=2a_0$. Thus, $\ell=\ell(d)$.

About 30 years ago I heard a talk where $\ell(d)$ was somehow related to the class number of $\mathbb Q(d)$ -- in particular, to the Gauss class number problem which conjectures that there are infinitely many natural $d$ for which class number is 1.

Unfortunately, I don't remember how to restate this conjecture via $\ell(d)$. Any reference would be helpful.

  • 1
    $\begingroup$ Should $a_0=\lfloor d \rfloor$ be $a_0=\bigl\lfloor \sqrt d\,\bigr \rfloor$? $\endgroup$ Apr 9, 2022 at 10:57
  • 2
    $\begingroup$ This should go via Pell's equation: if you want a fundamental unit for $\mathbb{Q}(\sqrt{d})$ then this amounts to solving $T^2-dU^2=1$, and this reduces to computing a continued fraction expansion of $\sqrt{d}$. Then the regulator of the field should give a connection back to class number. $\endgroup$ Apr 9, 2022 at 11:23
  • $\begingroup$ Yes, Joe. Fixed. $\endgroup$ Apr 9, 2022 at 11:32
  • 3
    $\begingroup$ For real quadratic fields, the regulator is just the logarithm of the fundamental unit. It is one of the quantities involved in Dirichlet's class number formula, class number itself of course being another. $\endgroup$
    – Wojowu
    Apr 9, 2022 at 11:55
  • 1
    $\begingroup$ The deleted answer of Henri Cohen contains a reference math.stackexchange.com/questions/438686 which is useful for real fields also: "one is able to express, for a prime $p$ of form $4m − 1$, $p > 3$, the class number of the quadratic field of discriminant $−p$ in terms of the period of the continued fraction for $p^{1/2}$ <i>whenever the class number of the quadratic field of discriminant $4p$ is one.</i>" $\endgroup$ Apr 9, 2022 at 17:55

1 Answer 1


Claude Levesque, On semi-reduced quadratic forms, continued fractions and class number, quotes a theorem of Lu, H., On the class number of real quadratic fields, Scientia Sinica II (special number, 1979), 118-130, as follows:

Let $m>1$ be a squarefree integer. Then the class number of ${\bf Q}(\sqrt m)$ is one if and only if $$\theta+\sum_{i=1}^{\ell}k_i=\lambda_1(m)+\lambda_2(m)$$ where $\omega=(1+\sqrt m)/2$ if $m\equiv1\bmod4$, otherwise $\omega=\sqrt m$, the continued fraction for $\omega$ is $[k_0,\overline{k_1,\dots,k_{\ell}}]$, $\theta$ is zero, one, or two depending on $m\bmod4$ and the parity of $\ell$ and $k_{\ell/2}$, and $\lambda_1(m)$ (respectively, $\lambda_2(m)$) is the number of solutions in nonnegative integers of $x^2+4yz=\Delta$ (respectively, $x^2+4y^2=\Delta$), where $\Delta$ is $m$ if $m\equiv1\bmod4$, otherwise $4m$.

For the detailed definition of $\theta$, see the paper of Levesque. The paper goes on to prove related results.

Another paper that may be relevant is Louboutin, Mollin, & Williams, Class Numbers of Real Quadratic Fields, Continued Fractions, Reduced Ideals, Prime-Producing Quadratic Polynomials and Quadratic Residue Covers, Canadian Journal of Mathematics 44 (1992) 824-842. DOI:10.4153/CJM-1992-049-0.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.