Thread: Set of residues

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 $\displaystyle \{0,36,9\}$ for 0,1 and 2 respectively and $\displaystyle \{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 $\displaystyle 0,1,4,9,16,25,36,49,64,81,100,...$ in modulo:

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

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

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

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

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

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

For all appropriate $\displaystyle n,k,r$

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

Sorry