1. ## Set of residues

Is there a complete set of residues modulo p consisting of perfect squares:

i). When p=7.

ii). for any prime p.
I can probably work out part ii). if I can do part i).

I think part i) is true but I can't figure out the set. My set so far is $\{0,36,9\}$ for 0,1 and 2 respectively and $\{25 \}$ for 4.

I can't find any perfect squares for 3,5 and 6!

2. ## There is no such set ever

Consider the sequence of squares $0,1,4,9,16,25,36,49,64,81,100,...$ in modulo:

$\bmod 7: 0,1,4,2,2,4,1,0,1,4,2,2,4,1,0,1,...$ (notice a pattern?)

Notice that $(n+7)^2-n^2=14n+7 \equiv 0 (\bmod 7)$, so the set repeats in blocks of $7$.

Also, $(7k+r)^2-(7k-r)^2=28kr \equiv 0 (\bmod 7)$ so the set "reflects" as shown in this example. More clearly, for any $k$, $(7k)^2 \equiv 0 (\bmod 7)$, therefore $(7k+r)^2 \equiv (7k-r)^2 (mod 7)$ for all $r$.

Both of these observations can be generalized. For any prime $p$,

$(n+p)^2-n^2 \equiv 0 (\bmod p)$

$(pk+r)^2-(pk-r)^2 \equiv 0 (\bmod p)$

For all appropriate $n,k,r$

Therefore, the size of the set of residues of $n^2$ for any prime $p$ is at most $\lceil \frac{p}{2} \rceil$

Sorry