# “Why are $1/2$ of the non-zero numbers in the mod $p$ system perfect squares and the other half not?”

"Why are $1/2$ of the non-zero numbers in the mod $p$ system perfect squares and the other half not?"

This is what led me to realize the part about how half of the non-zero numbers in mod $p$ system, (which is nine since not counting zero there are $18$ integers):

since I was able to prove through using a mod $19$ multiplication table that every non-zero number $a$, in the set of mod $19$, $\{1,2,3,\ldots,18\}$ has a multiplicative inverse, (proven by $2$ ways: $1$, that the GCD of both $a$ ($a$ in the set of mod $19$, $\{1, 2, 3,\ldots,18\}$ and $m$ (the modulus) is prime equaling a GCD of $1$, and that every row and column has a $1$.

So since a modular multiplicative inverse of $a \bmod p$ exists, the operation of division by $a$ mod $p$ can be defined as multiplying by the inverse, (which is the same thing as dividing in the field of mod $p$.

So then I was looking for more relationships between the integers $a$ in mod $p$ systems (using the mod $19$ multi. table which I'll include below) and noticed if I circled all the ones that there was a Main and Opposite lines of diagonal symmetry (the two diagonal black lines on the table). So on each side of the line the $1$'s were all reflective of each other ( the exact same on each side). which then made me think of perfect squares (multiplying the same number by itself which kinda made me think of symmetry) so I looked along the main diagonal line (which touched $18$ numbers) the first $9$ were perfect squares (the rest of the $9$ numbers were repeats of the first $9$) so the $9$ perfect squares in any prime mod are: $[(1, 4, 9, 16, 6, 17, 11, 7, 5)\pmod{19}]$.

$6 \bmod 19 =25$; $17 \bmod 19=36$; $11 \bmod 19=49$; $7 \bmod 19=64$; and $5 \bmod 19 =81$

Thanks if anyone can help:)

• WHY ARE YOU SHOUTING AT US? – John Dvorak Nov 7 '13 at 9:50
• $(p-k)^2 = p^2 - 2pk + k^2 \equiv k^2 \pmod{p}$. – Daniel Fischer Nov 7 '13 at 9:51
• I'm sorry you took it that way Jan. – user106100 Nov 7 '13 at 9:55

Firstly, $0$ is a square. Now exclude $0$.
If $a^2=b^2\bmod p$, then $(a-b)(a+b)=0\bmod p$.
So either $a=b$ or $a=-b$.
There are $p-1$ square-roots, hence $(p-1)/2$ square numbers.
• This is correct, although missing some details. It is necessary that $p$ is prime to conclude that $a=b$ or $a=-b$. It is necessary that $p$ is odd to conclude that $b\neq -b$, i.e. there are two square roots and not just one. – vadim123 Oct 31 '15 at 17:37