Does there exist asymptotic formula for ways to write n as sum of four squares? Or can this be proved impossible? I can only find reference for sums of five squares.



Asymptotic formula for sums of four squares?
The function you are asking for is $r\_4(n)$, the number of ways to write $n$ as a sum of four squares. The exact formula was discovered by Jacobi, and is given as


$$\displaystyle r\_4(n) = 8\sum\_{\substack{d | n \\ 4 \nmid d}} d.$$


