One of Jacobi's theorems states that the number of representations of a positive integer $n$ as a sum of two squares of integers equals $$4(d_1(n)-d_3(n)),$$ where the function $d_i$ counts the number of positive integer divisors congruent to $i \mod{4}$ of $n$.

My question is whether there are similar formulas for representations by the quadratic form $x^2+ay^2$, where $a$ is an integer other than $1$. If so, are there any references ?


The number of representations of any integer by positive definite binary quadratic forms of some discriminant can be expressed as a similar divisor like sum involving Jacobi symbols. This is given in general by Dirichlet's Mass formula. For instance when we have a discriminant $D=-28$ there is only one reduced form, namely $f(x,y)=x^2+7y^2$ thus we can write:

$$\#\{(x,y)\in \mathbb{Z}^2: n=x^2+7y^2 \text{ with } \gcd(x,y)=1\}=2\prod_{p\mid n}\left(1+\left(\frac{-7}{p}\right)\right)$$

For more details you can check out: http://math.ou.edu/~jcook/LaTeX/massformula.pdf

  • $\begingroup$ The last equality is not correct. Do you mean to take the sum over squarefree $d|n$ ? $\endgroup$ – Captain Darling Jun 23 '16 at 16:07
  • 1
    $\begingroup$ @CaptainDarling Sorry, I was counting the number of proper representations. I updated it. $\endgroup$ – Ethan Jun 24 '16 at 0:02

The requested generalization of Jacobi's two-square theorem is a remarkably recent result: N. Bagis and M.L Glasser, On the Number of Representations of Integers by various Quadratic and Higher Forms (2015):

where $r(n)$ is Jacobi's formula for the number of representations of $n=x^2+y^2$.

I understand from the comments that this (general but complicated) formula is not what the OP was looking for. Berkovich and Yesilyurt in Ramanujan's Identities and Representation of Integers by Certain Binary and Quaternary Quadratic Forms (2006) give rather simple expressions for specific cases of $n=x^2+ay^2$. I reproduce below the result for $a=5$, and there are others (6,15,27,...). As explained in this 2012 MO posting, there is no simple Jacobi-type formula that will apply to any $a$.

  • 3
    $\begingroup$ I don't consider this formula to be "similar" to Jacobi's formula - it is way too unwieldy. In cases that the binary form $Q = x^2 + ay^2$ has class number $1$, there should be a formula equating the theta series of $Q$ with an Eisenstein series, and be very similar to Jacobi's formula. This would occur only for $a = 1, 2, 3$ and $7$, though. $\endgroup$ – Jeremy Rouse Jun 22 '16 at 19:50
  • $\begingroup$ the formula immediately generalizes to more than two squares, $n=\sum_{k=1}^N A_k x_k^2$, see equation 15 of the cited paper; I find it actually more memorable than unwieldy. $\endgroup$ – Carlo Beenakker Jun 22 '16 at 20:37
  • 2
    $\begingroup$ I agree with Jeremy Rouse. The quoted formula (13) expresses in analytic form the simple fact that $\sum_{m+n=t}r_{A,B}(m)r_{A,B}(n)=\sum_{kA+lB=t}r(k)r(l)$. Indeed, both sides count the number of quadruples $(u,v,x,y)\in\mathbb{Z}^4$ such that $Au^2+Bv^2+Ax^2+By^2=t$. In contrast, Jacobi's formula has to do with arithmetic, e.g. the fundamental theorem of arithmetic in $\mathbb{Z}[i]$. $\endgroup$ – GH from MO Jun 22 '16 at 23:50

Several examples are in L. E. Dickson, Introduction to the Theory of Numbers. Jacobi's result is Theorem 65 on page 80, several forms of class number one are in the exercises pages 80-81. Several forms with one class per genus are exercises on pages 84-88, including a few odd discriminants.


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.