Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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

After seeing and doing a bunch of proofs like "For all $a$ in the natural numbers, then if $7$ does not divide $a$, then $7$ divides $a^3+1$ or $a^3-1$," I conjectured the following, but got stuck in proving it. I'd like to know if it has an actual name, or whether this is just something rather trivial and pointless.

Given a prime $p$ of the form $2n+1$, for all $a$ in the natural numbers if $p$ does not divide $a$, then $p$ divides $a^n+1$ or $a^n-1$.

*Assume non-trivial $a$

Thanks very much.

share|cite|improve this question
Every odd prime number is of the form $2n+1$, by the way. So it's every prime number except $2$. – Asaf Karagila May 5 '13 at 20:18
Fermat's little theorem. – Ma Ming May 5 '13 at 20:19
@AsafKaragila I was trying to make it clear. Stating it as an odd prime means I have to waste a sentence with defining n. But if there's a more elegant way of stating this, I'm all ears. – Thoth19 May 5 '13 at 20:41
up vote 4 down vote accepted

This is well known. Let $p = 2n + 1$ be an odd prime. Then, it is known that if $\gcd(a,p) = 1$, then $a^{p-1} = a^{2n} \equiv 1 \pmod{p}$, by Fermat's Little Theorem. Hence, $(a^n)^2 \equiv 1 \pmod{p}$ so that $a^n \equiv \pm 1 \pmod{p}$.

You do need to know that $x^2 \equiv 1 \pmod{p}$ has exactly two solutions when $p > 2$ is prime, but this is a consequence of $\mathbb{Z}_p$ (The integers mod $p$) being a (finite) field. When $p = 2$, we have $1 \equiv -1 \pmod{2}$ so that $x^2 \equiv 1 \pmod{p}$ has only one solution in this case.

share|cite|improve this answer
Thank you. I haven't used that one often enough or recently enough to recognize it. – Thoth19 May 5 '13 at 20:43

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.