TITLE: Number of representations as sums of squares in rings of integers of number fields
QUESTION [6 upvotes]: 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$.

REPLY [2 votes]: 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$.)