How can I prove that a sum of two integer squares, namely $ x^2 + y^2 $ (ranging from $ x = 0 \to p, \; y = 0 \to p $) is a complete system of residues (CSR) modulo $ p $ (prime)? Or, how can I prove that $ x^2 + y^2 \equiv \left \{ 0, 1, 2, \cdots, p-1 \right \} \pmod p $, for some integers $ x,y $ and all prime values of $ p $?
I've failed to prove $ \left (0, 1, 4, 9, 16, \cdots \right ) $ is a CSR modulo $ p $ , and I feel that this is an important step to solve my question.
I've also tried showing that Lagrange's four-square theorem solves the question, but it obviously gets stuck when $ x^2 + y^2 \equiv z \pmod p $, and $ z $ cannot be expressed as a sum of squares.
Consider the prime $p=5$. The square sequence you mentioned is here $0, 1, 4$. This is not a complete system of residues modulo $p$
– Zavosh Sep 30 '14 at 11:20