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, user17762, Asaf Karagila, davidlowryduda May 29 '12 at 9:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ Yes, this is correct. $\endgroup$ – KReiser May 28 '12 at 22:32
  • 4
    $\begingroup$ 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}$. $\endgroup$ – Arturo Magidin May 28 '12 at 22:33
  • 1
    $\begingroup$ 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$). $\endgroup$ – chris May 28 '12 at 23:48
  • 1
  • 1
    $\begingroup$ I upvoted and voted to close. $\endgroup$ – The Chaz 2.0 May 29 '12 at 0:52

Yes. Generally if $\rm\:p\:$ is prime, then modulo $\rm\,2p,\,$ 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. More succinctly, exploiting negation reflection symmetry: $\rm\: q\equiv \pm\{1,3,5,\cdots,p\!-\!2\}\ \ (mod\ 2\:\!p),\ $ e.g. $\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, if $\rm\,q\,$ is any integer coprime to $\rm\:m\:$ then its remainder mod $\rm\:m\:$ lies in one of the $\rm\:\phi(m)\:$ residue classes coprime to $\rm\:m,\:$ where $\phi$ is the Euler totient function.

  • $\begingroup$ @Downvoter: if something is not clear then please feel welcome to ask for elaboration. $\endgroup$ – Bill Dubuque May 29 '12 at 0:37
  • $\begingroup$ Weird. I'll do my best to restore balance to the Force... $\endgroup$ – The Chaz 2.0 May 29 '12 at 0:52

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.


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