# Fermat's little theorem

1. Aug 24, 2008

### acarchau

From fermat's little theorem we have for a prime to a prime p : $$a^{p-1}\equiv 1$$(mod p). Assuming p-1 to be even we must have either $$a^{\frac{p-1}{2}}\equiv 1$$ (mod p) or $$a^{\frac{p+1}{2}}\equiv -1$$ (mod p). Are there any special cases in which it is easy to determine which of the previous two conditions holds without a lot of compution?

Last edited: Aug 24, 2008
2. Aug 25, 2008

### Hurkyl

Staff Emeritus
3. Aug 26, 2008

thank you!