Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose p is an odd prime and a $\in$ $\mathbb{Z}$ such that $ a \not\equiv 0 \pmod p$. What are all the values of $ x \equiv a^\frac{p-1}{2} \pmod p$ ?

This is what I got so far:

$ x^2 \equiv a^{p-1} \pmod p$

By Fermat's Little Theorem,

$ x^2 \equiv 1 \pmod p$

$ x^2 - 1 \equiv 0 \pmod p$

$ (x - 1)(x+1) \equiv 0 \pmod p$

$\;p\mid(x-1)\;\; or\;\; p\mid(x+1) \;$

share|cite|improve this question
So $x\equiv 1\pmod{p}$ or $x\equiv -1\pmod{p}$. You may be expected to explain why both are achievable for any odd prime $p$. – André Nicolas Feb 10 '14 at 19:42
what do you mean? – sarah Feb 10 '14 at 19:46
You had basically proved (except for not quite finishing) that $x\equiv \pm 1\pmod{p}$. It is obvious that $1$ is possible for any $p$ (let $a=1$). To show that there is an $a$ such that $a^{(p-1)/2}\equiv -1\pmod{p}$, let $a$ be any quadratic non-residue of $p$, – André Nicolas Feb 10 '14 at 19:51
Can you explain what is a quadratic non-residue of p? – sarah Feb 10 '14 at 20:09
It is a number $b$ not divisible by $p$ such that there is no $y$ such that $y^2\equiv b\pmod{p}$. Informally, it is a non-square modulo $p$. – André Nicolas Feb 10 '14 at 20:15

$x^2=1 \pmod p \Rightarrow x=\pm 1\pmod p$

share|cite|improve this answer

Do you know about quadratic residues ?
The values of $x$ are $1$ and $-1$.
$\frac{p-1}{2}$ values of $1$ and also $\frac{p-1}{2}$ values of $-1$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.