# Is $p^2+q^2+r^2=3^k$ with primes $p,q,r$ solvable for every odd positive integer $k\ge 3\$?

For the positive odd integers $3\le k\le 25$, the equation $$p^2+q^2+r^2=3^k$$ with primes $p,q,r$ is solvable. Here is one solution for every exponent , calculated with PARI/GP :

[3, 3, 3, 3]
[5, 7, 13, 5]
[7, 17, 43, 7]
[5, 83, 113, 9]
[23, 173, 383, 11]
[109, 859, 919, 13]
[7, 677, 3727, 15]
[5, 2053, 11177, 17]
[5, 5659, 33619, 19]
[29, 35999, 95731, 21]
[277, 47407, 303143, 23]
[19, 124231, 912061, 25]


Does such a solution exist for every odd positive integer $k\ge 3\$ ?

We can assume $p\le q\le r$, equality is allowed. Since $3^k\equiv 3\mod 8$ , a solution , if it exists , contains only odd primes and because of the divisibility by $3$, we can rule out prime $3$ as well except in the case $k=3$ ; either every summand or none must be disisible by $3$.

It is clear that evey power of $3$ is sum of three perfect squares, but it is unclear whether each square can be the square of a prime number.

I found multiple solutions for small exponents $k$, so there might be a solution for every $k\ge 3\$.

• Solution for $k=27$ : $$[406993, 532867, 2678807]$$ – Peter Jun 17 '18 at 9:29
• Solution for $k=29$ : $$[2086879, 3756001, 7082921]$$ – Peter Jun 17 '18 at 9:33
• Solution for $k=31$ : $$[4975013, 16000447, 18355063]$$ – Peter Jun 17 '18 at 9:40
• Very heuristicallly: Below $n$, there are about $\frac{\sqrt n}{2\ln n}$ odd prime-squares $p^2$. hence below $2n$ about $\frac n{8\ln^2n}$ numbers $p^2+q^2$, so the chance that $n=p^2+q^2$ is about $\frac1{16\ln^2n}$ - or if we already know that $n$ is "right" modulo $8$ and $3$, about $\frac3{2\ln^2n}$. Finally, we have $\frac{\sqrt n}{2\ln n}$ candidates of $r$ to try. It is quite likely that $n-r^2=p^2+q^2$ for at least one $r$. – Hagen von Eitzen Jun 17 '18 at 10:00
• Solution for $k=33$ : $$[8676119, 17236489, 72018671]$$ – Peter Jun 17 '18 at 10:08