# Is there a number $k$ such that every integer $n\ge 24$ is a sum of at most $k$ squares of a prime?

Suppose, $n\ge 24$ is a natual number. Then, $n$ can be written as a sum of squares of primes (the squares of the primes need not be distinct) because $n$ can always be written in the form $4a+9b$ with non-negative integers $a,b$. So, we can find primes (not necessarily distinct) such that $$(1)\ \ \ \ p_1^2+p_2^2+\cdots+p_k^2=n$$

But is there a positive integer $k$, such that every positive integer $n\ge16$ can be written as a sum of at most $k$ squares of a prime ? In other words, a number $k$ , such that $(1)$ has always a solution ?

• According to my calculations so far, $k=7$ is not sufficient (take $n=32$), but $k=8$ might work. – Peter Mar 11 '17 at 23:21
• This is not a trivial problem, it involves Weyl's and Vinogradov's bounds on exponential sums over squares or primes and Hardy's circle method. Due to arithmetic constraints $\pmod{8}$, my bet is that every sufficiently large positive integer can be written as the sum of $8$ prime squares, but probably "sufficiently large" means $n\geq N$ with $N\gg 16$. – Jack D'Aurizio Mar 11 '17 at 23:22
• @JackD'Aurizio I currently search an $n$, for which $k=8$ is not sufficient. – Peter Mar 11 '17 at 23:23
• It looks like a good idea to add some heuristics and classical methods in additive number theory for dealing with the $p^2$ terms, if there are any. – Jack D'Aurizio Mar 11 '17 at 23:26
• what would happen if n is decomposed into 4 squares and then each of these squares is in turn decomposed into 4 squares...until we end up only with primes. – user25406 Mar 12 '17 at 0:48