20230406, 12:48  #12  
Feb 2017
Nowhere
2^{2}×3^{2}×181 Posts 
Quote:
For e > 1, the integers (mod p^e) are no longer a field; the multiplicative group no longer consists of all nonzero residues. The multiples of p, a*p for a = 1 to p^(e1)  1, are nonzero (mod p^e) but are not in the multiplicative group. 

20230406, 22:37  #13 
Dec 2022
1000100010_{2} Posts 
Of course I meant coprime residues in that context  it is correct with that restriction  and my reference to the multiplicative group rather indicated this.
The final point, again, is that x^2 + y^2 = 1 mod k has solutions if and only if k does not divide by 4. I don't think you disagree with that. 
20230407, 12:46  #14  
Feb 2017
Nowhere
1974_{16} Posts 
Quote:
Unfortunately, if you start at 1 and keep adding 1 modulo p^e for e > 1, you will run into multiples of p before you get to 0 (mod p^e), so that argument doesn't really work any more. My first proof  the one which appeals to Dirichlet's theorem  carries through for residues modulo p^e which are prime to p, for any odd prime p. It doesn't rely at all on the fact that the multiplicative group mod p^e is cyclic. If you actually have a proof that x^2 + y^2 == 1 (mod p^e) is solvable for odd prime p and e > 1, and which uses the fact that the multiplicative group is cyclic, by all means trot it out. 

20230407, 23:54  #15 
Dec 2022
2×3×7×13 Posts 
I didn't claim to have such a proof, but here's something. Note that I used the cyclicity of the group initially just for my short proof that the coprime residues mod p^e are equivalent to those mod p. But we can go farther with that  your 'Proof 2' can be used mod p^e, because we just find a pair mod p (guaranteed to be nonzero) and use that mod p^e  the multiplication step still works for the cyclic group, and gives all coprime nonresidues.
Adding a few other pieces, we can get the most general statement that x^2 + y^2 = a mod b has solutions unless  a mod b is 3 mod 4 or any power of 2 times that, or  a divides by an odd power of a prime 3 mod 4, and b divides by a higher power of the same. 
20230408, 13:16  #16  
Feb 2017
Nowhere
2^{2}·3^{2}·181 Posts 
Quote:
Refining a solution of the congruence x^2 + y^2 == k (mod p) for odd prime p to a solution modulo a higher power of p is not trivial. The usual direct argument uses successive approximations. The oddness of p is crucial in making the refinement work in going from (mod p) to (mod p^2). Also crucial is that at least one of x and y (say x) be nonzero (mod p). I note that assuming x is not 0 (mod p) also allows refinement to solutions to x^2 + y^2 == k +m*p (mod p^2). It is also not trivial to prove that the multiplicative group (mod p^e) is cyclic for odd prime p and e > 1. Again, the usual argument uses successive approximations. And, AFAICT, the fact that the group is cyclic is totally irrelevant to refining solutions of x^2 + y^2 == k (mod p) to solutions (mod p^e). I note that for p == 3 (mod 4), the only solution to x^2 + y^2 == 0 (mod p) is x == y == 0 (mod p). This fact disallows any "refinement" to x^2 + y^2 == m*p (mod p^2) for 0 < m < p. However, there are many nontrivial solutions to x^2 + y^2 == 0 (mod p^2), e.g. x == p, y == p (mod p^2). 

20230408, 21:49  #17 
Dec 2022
222_{16} Posts 
I am not sure where you are going here, but I have no wish to argue further or expand the discussion. I took the cyclic nature of the groups as given and observed that, whatever term you wish to use for it, it is then easily seen that the (coprime) quadratic residues (actually, the residues to any power not divisible by p) mod p^e map to those mod p in the obvious sense.
Nor was I ever addressing the construction or enumeration of the sumofsquares solutions, but only their existence. Finally I clearly know of the difference between primes 1 mod 4 and 3 mod 4 respecting the sum of residues; that's where the last qualification of my last post comes from. 