# Number of representations as sums of squares in rings of integers of number fields

Let $K$ be some number field, $\mathcal O_K$ denote its ring of integers, and let $n$ be a positive integer. Take $\alpha \in \mathcal O_K$, and consider the quantity $r_{n,K}(\alpha)$, which denotes the number of solutions to the equation $$\alpha = x_1^2 + x_2^2 + \ldots + x_n^2$$ with $x_1, x_2, \ldots, x_n \in \mathcal O_K$.

When $K=\mathbb Q$ and $\mathcal O_K=\mathbb Z$, the precise formulas for the computation of $r_{n,K}(\alpha)$ were developed for all $n \leq 4$ (perhaps for other $n$'s as well, but I am not familiar with them). Are there any formulas for $r_{n,K}(\alpha)$ when $[K:\mathbb Q] > 1$? I am especially interested in the cases when $n = 2, 3, 4$ and $K$ is a real quadratic extension of $\mathbb Q$.

• On page 11 of "A first course on modular forms" by Diamond and Shurman it is shown that a generating function counting solutions can be made into a modular firm for a congruence subgroup. Using this, the weight of the form, its level, some analysis to find the corresponding vector space of modular forms you may actually be able to recover the generating function. This works over the rationals, and I guess that you can use Hilbert modular forms over totally real fields (such as real quadratic fields). – Pablo Aug 5 '15 at 1:09
• Have a look at the following survey for the subtleties of the ternary case over totally real number fields (the quaternary case is simpler): arxiv.org/abs/1402.1332 – GH from MO Aug 5 '15 at 12:20

There are some results known in the $n = 4$ case. In particular, in 1928 Gotzky (see Mathematische Annalen volume 100 pages 411-437) proved a formula for the number of representations of a totally positive integer $\alpha \in \mathcal{O}_{K}$ as a sum of four squares of elements in $\mathcal{O}_{K}$ for $K = \mathbb{Q}(\sqrt{5})$. In 1960, Harvey Cohn wrote a paper (in the American Journal of Mathematics, pages 301-322) determining formulas when $K = \mathbb{Q}(\sqrt{2})$ and $K = \mathbb{Q}(\sqrt{3})$. A 1961 paper of Cohn addresses the question of sums of three squares over $\mathbb{Q}(\sqrt{2})$ (where there is a formula) and $\mathbb{Q}(\sqrt{3})$ (where there might not be as clean a formula).

Kate Thompson, a recent Ph.D. student of Jonathan Hanke and Daniel Krashen, has been working on extending results about sums of four squares to other quadratic number fields.

For $n=4$, in addition to what Jeremy mentioned, there is some addition information in the answers to sum of squares in ring of integers. John Goes has also done some work but it seems his preprint is not yet available.

There are also some results for $n=2$ and $n=3$.

For $n=3$, see Donkar's 1977 American Journal paper. He uses quaternion algebras over number fields like he did earlier over $\mathbb Q$. He has fairly general results with just an assumption on the even primes of the number field, and he worked out some very explicit statements in several examples such as $\mathbb Q(\sqrt 5)$, $\mathbb Q(\sqrt 2)$ and $\mathbb Q(\sqrt 17)$.

For $n=2$, there has at least been work for $\mathbb Q(\sqrt 2)$. See Michele Elia & Chirs Monico's paper On the Representation of Primes in $\mathbb Q(\sqrt 2)$ as Sums of Squares (JP Journal of Algebra, Number Theory, 2007).

(There has been other work over imaginary quadratic fields when $n=2$, but I'm not sure about other results over totally real fields right now. There are also results for $n>4$.)