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

Prove or disprove that all primes except $2$ and $3$ can be expressed in the form $6n\pm1$ which $n\in\mathbb{N}$.

I observe this when I'm reading the prime table. Is this already a theorem or it's new? Thank you.

share|cite|improve this question
Consider the possible remainders when a prime $p$ is divided by 6. – Ted Sep 30 '12 at 17:09
up vote 5 down vote accepted

Note that the form $6n - 1$ is of the same type as $6n + 5$. We have 6 types of integers : $6n , 6n+1 , 6n+2 , 6n+3 , 6n+4 , 6n+5$.

Clearly $6n , 6n+2$ and $6n+4$ are even.

Also clear is that $6n+3$ is divisable by 3.

So we sieve out $6n,6n+2,6n+3,6n+4$.

We are left with $6n+1$ and $6n+5$ and we conclude that all positive integers not divisible by 2 or 3 must thus be of the form $6n+1$ or $6n+5$.

Since primes > 3 are not divisible by 2 or 3 they must thus be of type $6n+1$ or $6n+5$. QED

This is basicly how sieves work , you might be intrested in Sieve of Eratosthenes.

share|cite|improve this answer
THANKS! ~ ${}{}$ – ᴊ ᴀ s ᴏ ɴ Oct 1 '12 at 5:09
@jasoncube : Your welcome. – mick Oct 2 '12 at 20:23

It is known. Any number greater or equal to than $6$ that is of the form $6n, 6n+2, 6n+3,$ or $6n+4$ will have a factor of $2$ or $3$, so cannot be prime. And $5=6\cdot 1 -1$

share|cite|improve this answer

Hints (Not necessarily related to each other!):

== What are the units in the ring $\,\Bbb Z_6:=\Bbb Z/6\Bbb Z\,$ ?

== What is $\,\phi(6)\,$ , with $\,\phi=\,$ Euler's totient function

== For any prime$\,p>3\,\,,\,\,(6,p)=1\,$

share|cite|improve this answer

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.