Groups related to sum of squares function?

I will begin by saying that $k=3$ might be a very specific case and this question is useless. Even if that is the case, I would like to know...

The sum of squares function $r_k(n)$ is very famous. It counts the number of ways $n$ can be written as a sum of $k$ squares. In the case of $k=3$, when $n$ is squarefree and not $7\mod{8}$, $r_k(n)$ is related to the class number of $\mathbb{Q}(\sqrt{-n})$. In the next (at least) two odd cases the function is still related to arithmetic constants of quadratic fields. C.f. "On the Representation of a Number as the Sum of any Number of Squares, and in Particular of five or seven", Hardy, 1918.

Question

Are the numbers $r_k(n)$ known to be related to special groups, like when $k=3$?

Smaller Question

Is there a book with an in-depth account of these numbers and their arithmetic significance? (more than expressing them as coefficients of a modular form and proving bounds and (lots of) relations...)

-
There's the book Sums of Squares of Integers by Moreno and Wagstaff: books.google.co.uk/… but I'm not sure that does exactly what you ask for. –  Robin Chapman Jun 6 '10 at 18:31
hmm, for k=4 it is the sum of the divisors of n not divisible by 4. This comes from the fact that the generating function is a modular form on a suitable congruence subgroup of SL_2(Z). So at least it has some connection to an algebraic object. –  Tobias Kildetoft Jun 6 '10 at 22:34
@Tobias: All the numbers $r_k(n)$ come from modular forms. Koblitz's book Introduction to Elliptic Curves and Modular Forms contains information on the theta function and its powers. –  Dror Speiser Jun 7 '10 at 6:42
Dror, I simply cite the Chan-Krattenthaler article (mat.univie.ac.at/~kratt/artikel/SquareSurvey.html): "These formulas (for the number of representations by triangular numbers $t_{4s^2}(n)$ and $t_{4s(s+1)}(n)$ - WZ) follow from a conjectural affine denominator formula for simple Lie superalgebras..." Isn't that a sufficient algebraic context? The situation with squares is very similar (although I am not sure that they are directly related to Kac-Wakimoto). –  Wadim Zudilin Jun 7 '10 at 7:30
Is there any reference for this? That is the only statement in the article about Lie superalgebras, and the reference they give is only about the structure, and not the comment. –  Dror Speiser Jun 7 '10 at 20:15

In my view, it depends a little what you mean by "related," but I don't see at first glance any natural group whose order is r_k(n) for any k other than 3. Loosely speaking, representations of a form of rank m by the genus of a form of rank n are related to the set of double cosets

H(Q) \ H(A_f) / H(Zhat)

where H is a form of SO_{n-m} (this can be found e.g. in my paper with Venkatesh "Local-global principles..." but is certainly known to others). When H is abelian (i.e. when n-m = 2) this is naturally a group, otherwise not.

-
Little harm in repeating this, Dror was quite pleased with your paper "Local-global principles..." and torsors, see the (currently) sixth comment after my answer. –  Will Jagy Jun 11 '10 at 1:57

Steve Milne sent me a copy, and a pdf, of his "Infinite Families of Exact Sums of Squares Formulas, Jacobi Elliptic Functions, Continued Fractions, and Schur Functions" which is an entire issue of The Ramanujan Journal: vol. 6, no. 1, March 2002. There is also a two-page preface by George Andrews. I admit, the main focus is dimension $4 n^2$ or $4 ( n^2 + n).$ But at 143 pages and 259 references, there might be something you like. Email me if you would like the pdf, it is not obvious to me that there was implied permission for me to post it on any websites.

-
Here is the link to the paper: dx.doi.org/10.1023/A:1014865816981. There are simpler proofs of the result (probably not mentioned in Milne's paper) by D. Zagier [Math. Res. Lett. 7 (2000) 597--604], K. Ono [J. Number Theory 95 (2002) 253--258], and H.H. Chan and C. Krattenthaler [Bull. London Math. Soc. 37 (2005) 818--826]. –  Wadim Zudilin Jun 7 '10 at 3:46
A paper on five, seven and nine squares is Shaun Cooper's "Sums of five, seven and nine Squares" also in the Ramanujan Journal vol. 6 (2002) 469-490. –  Robin Chapman Jun 7 '10 at 6:43
You might also want to have a look at the very nice paper of Bodo Lass , Démonstration de la conjecture de Dumont, C. R. Math. Acad. Sci. Paris 341 (2005), no. 12, 713--718. –  Roland Bacher Jun 7 '10 at 8:42
Thanks, the articles are very impressive! I looked over them and reading more carefully now. Just a note, none mention any arithmetic groups. –  Dror Speiser Jun 7 '10 at 20:13
As you like groups, you might look at Ellenberg and Venkatesh arxiv.org/pdf/math/0604232 and the follow-up by Schulze-Pillot, arxiv.org/pdf/0804.2158 although in these the groups may not be the type you want and these focus on existence of representations, rather than counting them when existence is already known. Oh, well. My earlier comment stands as far as my own limited background, I haven't seen anything on five or seven squares that screams number field. –  Will Jagy Jun 7 '10 at 20:44

For general odd $k=2m+1$ one can still compute the value of the singular series as Hardy does and obtain a formula similar to those for $k=5,7$, involving the value of an $L$-series with quadratic character at $s=m$. A relation to special groups as in the case $k=3$ is not visible from this, just a relation to the arithmetic of quadratic number fields.

For $k \ge 9$, however, the genus of the sum of $k$ squares contains more than one integral equivalence class and by Siegel's Massformel (mass formula) evaluation of the singular series gives the average of the representation numbers for the equivalence classes in the genus and not the representation number of the individual form. (The genus of an integral quadratic form $q$ consists of those forms which have the same signature and are integrally equivalent modulo $m$ for all integral $m$.) Of course this doesn't exclude the possibility of finding a closed formula by other means, as was the case for the special dimensions of the form $4m^2$ or $4(m^2+m)$ in the work of Milne mentioned in Jagy's answer. To my knowledge at present no such formula is known for an odd number $k$ of variables.

Concerning references: The standard reference for sums of squares is still Grosswald's book. Good references for more general questions concerning the arithmetic of quadratic forms are the books of B. Jones, Y. Kitaoka, O. T. O'Meara, G. Shimura and (in german) of M. Eichler and of M. Kneser.

-
It's been a long time since I looked at Grosswald's book, so I may misremember this, but doesn't he look at the sums of $\textit{positive}$ squares? –  Victor Protsak Jun 10 '10 at 22:08