Let $a \in \mathbb{Z}$ and $p > 2$ be a prime number.
What values can $a^{\frac{p-1}{2}}\bmod p$ take?
I am a bit dumbfounded by this question? By Fermat we know that $a^{p-1} \equiv 1 \bmod p$.
After testing some values it seemed to me that the equation can take values that are just the opposite, concretely: $p\mid a^{\frac{p-1}{2}} +1$.
The question itself doesn’t ask for a prove, just what values it can assume. Would the set of prime numbers minus one be the right answer? I'm a little lost.