# For which prime powers are there solutions to $x^{2} + y^{2} = 0 \pmod {p^a}$ with $(x,p) = (y,p) = 1$?

I have a problem about Jacobi and Legendre Symbols and don't know how to approach it properly since I am new to this subject. For this problem I tried to show that $$\left(\dfrac{-1}{p^a}\right) = 1$$ and got lost so any help would be awesome.

• Remember that the Jacobi symbol can equal $1$ even without there being solutions to a congruence, such as $(\frac{-1}{9}) = (\frac{-1}3)^2 = 1$. – Greg Martin Aug 12 at 5:15
• Yea, I forgot about that, so is this approach of mine feasible? – user799951 Aug 12 at 5:17
• First of all, there's always solutions where $p^a$ divides both $x$ and $y$, for example; perhaps you want to exclude such solutions. The standard way to go from information modulo primes to information modulo their powers is Hensel's lemma. – Greg Martin Aug 12 at 5:18
• I have found that p = 1 mod 4 for $x^{2}$ + $y^{2}$ = 0 (mod p) to have solutions but I don't know how to go from that – user799951 Aug 12 at 5:22
• If you want solutions where $x$ and $y$ are coprime to $p$, then the admissible $p^a$ are $2$ and $p^a$ for $p\equiv1\pmod4$. – Angina Seng Aug 12 at 5:29

I'm assuming $$xy\neq 0$$. As I see it, there are three cases: $$p\equiv 1 \pmod 4$$, $$p=2$$, $$p\equiv 3 \pmod 4$$.
1. $$p\equiv 1 \pmod 4$$: Using Gaussian integers, one can show $$X^2+Y^2=p$$ has a solution. Then the Diophantus identity $$(a^2+b^2)(c^2+d^2)=(ac+bd)^2(ad-bc)^2$$shows the set of integers expressible as a sum of two squares is closed under multiplication, whence the result follows.
2. $$p=2$$: Clearly $$(x,y)=(1,1)$$ is a solution for $$a=1$$. For $$a>1$$ there are clearly no solutions because you've specified $$(x,2)=(y,2)=1$$, which can't be satisfied modulo $$4$$.
3. $$p\equiv 3 \pmod 4$$: If $$a$$ is odd, there are no solutions because $$x^2+y^2 \equiv 0,1,2\pmod 4$$ but $$p^a\equiv 3\pmod 4$$. If $$a$$ is even, there are no solutions either because as @Greg Martin mentioned, the Jacobi symbol yields a valid solution only if every prime factor gives $$1$$, but we showed there is no solution mod $$p$$.