Lower bound for the number of representations of integers as sum of squares Let $k\geq 4$. As usual, let $r_k(n)$ denote the number of ways to represent $n$ as the sum of $k$ squares. Is this true that for every $\varepsilon>0$, one has $r_k(n) \gg n^{\frac{k}{2}-1-\varepsilon}$ ? Is there an easy proof of this fact? What can we say about the cases $k=2,3$?
Many thanks !
 A: For $k=4$, your statement would be that $r_4(n) \gg n^{1-\epsilon}$. This is false. Jacobi's four-square theorem can be stated as that $r_4(n)/8$ is the sum of the divisors of $n$ that are not divisible by $4$. Let $n = 2^t m$ with $m$ odd and $t$ positive. $r_4(n) = 24 \sigma (m)$ independent of $t$. In particular, for $m=1$, you can express $n=2^t$ as a sum of $4$ squares in $24$ ways, scaled up versions of the $24$ ways to express $2$ and $4$ as sums of $4$ squares. $24$ doesn't grow with $n$.
For $k=4$, $n$ odd, the statement is trivially true (after Jacobi's four-square theorem) since the odd divisors of $n$ include $n$ itself.
For $k \gt 4$ this follows easily by reducing to the case of $k=4$, $n$ odd. Choose the first $k-4$ squares to be at most $\frac{n/2}{k-4}$ so that the remainder is odd. This can be done in about $\frac{1}{2} \left(\frac{n/2}{k-4}\right)^{(k-4)/2}$ ways. You can complete each of these to a representation of $n$ as a sum of $k$ squares in at least $n/2$ ways, so $r_k(n) \ge c(k) n^{k/2-1}$. 
A: Complementing Douglas Zare's answer, for $k=3$ see the responses here.
Regarding the case of $k=2$, the number of representations $r_2(n)$ as a sum of two squares is often zero (so there is no lower bound), but it behaves much like $d_2(n)$. Indeed, superficially the first quantity counts the number of representations $n=a^2+b^2$, while the second quantity counts the number of representations $n=ab$. At a deeper level, $r_2(n)$ equals $4\sum_{d\mid n}\chi(n)$, where $\chi$ is the nontrivial Dirichlet character modulo $4$, while $d_2(n)$ equals $\sum_{d\mid n} 1$ by definition. At any rate, the large values of $r_2(n)$ are much the same as those of $d_2(n)$, i.e. these functions have similar maximal order etc. (For $r_2(n)$ the largest values are produced by the products $n=q_1q_2\dots q_k$, where $q_1<q_2<\dots$ is the sequence of primes congruent to $1$ modulo $4$.)
