# Proving all primes are 1 or -1 modulo 6 [duplicate]

Possible Duplicate:
Is that true that all the prime numbers are of the form $6m \pm 1$?

Q. Why is it that all primes greater than 3 are either 1 or -1 modulo 6?

Does it suffice to argue as follows:

Let $p$ be a prime. $p>3 \Rightarrow 3$ does not divide $p$. Clearly $2$ does not divide $p$ either, and so 6 does not divide p.

Now, $p$ is odd, and so $p$ is either 1,3 or 5 modulo 6. However, if $p$ were 3 (mod6), that would give us that $3$ divides $p$, which is a contradiction.

As such, we conclude that $p$ is either 1 or 5 (=-1) mod 6

-

## marked as duplicate by Jonas Meyer, The Chaz 2.0, Marvis, Asaf Karagila, mixedmath♦May 29 '12 at 9:00

Yes, this is correct. – KReiser May 28 '12 at 22:32
Yes, that's fine. Alternatively, note that if $n\equiv 0,3\pmod{6}$ then it is divisibly by $3$, and if $n\equiv 2,4\pmod{6}$, then it is divisible by $2$; so if $n$ is prime and greater than $3$, that only leaves $n\equiv 1,5\pmod{6}$. – Arturo Magidin May 28 '12 at 22:33
I think it's worth noting that this is equivalent to showing that all primes are congruent to $1$ or $3 \pmod{4}$ (except in this case you don't need the assumption that $p>3$). – chris May 28 '12 at 23:48
– Jonas Meyer May 29 '12 at 0:40
I upvoted and voted to close. – The Chaz 2.0 May 29 '12 at 0:52

Yes. Generally if $\rm\:p\:$ is prime, then modulo $\rm\:2\:\!p,\:$ any prime $\rm\:q\ne 2,p\:$ must lie in one of the $\rm\:\phi(2p) = \phi(p) = p\!-\!1\:$ residue classes that are coprime to $2$ and $\rm p,$ i.e. all odd residue classes excluding $\rm p,\:$ viz. $\rm\:1,3,5,\ldots,\hat p,\ldots,2p\!-\!1.\:$ Indeed, integers in other classes are divisible by $2$ or $\rm p\:$ hence, if prime, must be $2$ or $\rm p,\:$ resp. Exploiting reflection symmetry we can state this more succinctly: $\rm\: q\equiv \pm\{1,3,5,\cdots,p\!-\!2\}\ \ (mod\ 2\:\!p),\:$ so $\rm\: q\equiv \pm 1\ \ (mod\ 6),\:$ $\rm q\equiv \pm\{1,3\}\ \ (mod\ 10),\:$ $\rm q\equiv\pm \{1,3,5\}\ \ (mod\ 14),\:$ etc.
Generally, any integer coprime to $\rm\:m\:$ must, modulo $\rm\:m,\:$ lie in one of the $\rm\:\phi(m)\:$ residue classes coprime to $\rm\:m,\:$ where $\phi$ is the Euler totient function.
We have $6| 6n$, $2| 6n+ 2$, $3|6n+3$, and $2|6n + 4$ for all integers $n$. That leaves the $6n+1$s and $6n+5$s as possible primes, save for 3 and 2.