# Understanding why $(\frac{a}{p}) \equiv a^{(p-1)/2} \pmod p$ when $p \mid a$

Let p be any prime, then

$\left(\frac{a}{p}\right) \equiv a^{(p-1)/2}$ (mod $p$)

For the case $p|a$, the textbook just says it is obviously.

If $p|a$, is $a^{(p-1)/2}\equiv0$ (mod $p$), am I correct?

From the definition, we know

Given $p$ is an odd prime, the Legendre symbol $\left(\frac{a}{p}\right)=0$ if $p|a$

But Why $\left(\frac{a}{p}\right) = 0$? In such case(i.e $(a, p) \neq 1)$, is $a$ neither a quadratic residue nor a quadratic nonresidue modulo m?

You are correct saying that if $p$ divide $a$, then $a^{(p-1)/2}\equiv 0\bmod p$. In fact, $a\equiv 0\bmod p$, which is stronger.
Regarding your other question, $a$ is either a quadratic residue $\bmod p$ or a quadratic nonresidue $\bmod p$. This is exactly the same saying that your jacket is either blue or not blue. The point is that $\displaystyle\left(\frac{a}{p}\right)=1$ if and only if $a$ is a nonzero quadratic residue $\bmod p$.
• Yea, I'm confusing on how to prove the property. Why you say $a$ is either a quadratic residue mod $p$ or a quadratic nonresidue mod $p$? The definition states that $\left(\frac{a}{p}\right) = 1$ if $a$ is a QR, $\left(\frac{a}{p}\right) = -1$ if $a$ is a QNR， $\left(\frac{a}{p}\right)=0$ if $p|a$. – yashirq Nov 28 '16 at 2:37
• Isn't $0$ a quadratic residue? Or maybe your definition of quadratic residue $\bmod p$ is that $a$ is nonzero and there exists $b$ such that $a\equiv b^2\bmod p$. – C. Falcon Nov 28 '16 at 2:39
• My definition is base on $(a, p) = 1$ – yashirq Nov 28 '16 at 2:53