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 that, if first and last numbers out of 3 consecutive numbers are prime, the middle number is divisible by 6.


say $x-1, x, $and$ x+1$ are the numbers, then,

if $x-1$ and $x+1$ are prime numbers,

prove $x$ is divisible by 6.

an exception: (3, 4, 5): It is true for all but this case.

share|cite|improve this question
what about 4? 3 and 5 are prime, but 4 is clearly not divisible by 6. – Holdsworth88 Jan 18 '12 at 20:49
with that as an exception – hrishikeshp19 Jan 18 '12 at 20:51
up vote 5 down vote accepted

Counterexample: the first and last of 3, 4, 5 are prime, but 4 is not divisible by 6.

EDIT: Can you show that under the hypotheses $x+1$ must be odd, so $x$ must be even? Can you show that in any three consecutive numbers at least one is a multiple of 3? Can you show that if a number is a multiple of 3 and also a multiple of 2 then it's a multiple of 6?

share|cite|improve this answer
just 1 exception – hrishikeshp19 Jan 18 '12 at 20:53
Ok. I got your point. The statement cannot be true with an exception. Thanks. – hrishikeshp19 Jan 18 '12 at 21:02

Ok. Since $x-1$ and $x+1$ are prime, we must have $x$ divisible by 2. Furthermore, one of $x-1,x,x+1$ is divisible by 3. Since $x-1,x+1$ are prime, we are forced to conclude $x$ is divisble by $3$. Thus it is divisible by 6.

share|cite|improve this answer
with the exception of $x-1=3$ ofcourse ;) – ratchet freak Jan 18 '12 at 20:58

HINT $\ $ More generally, $\rm \ p,\ p+2\ $ both coprime to $\rm6\ \Rightarrow\ p\:\equiv\: -1\ \Rightarrow\ p+1\:\equiv\: 0\pmod 6$

Proof $\rm\ \ p\:$ coprime to $\rm6\ \Rightarrow\ p\equiv \pm1\pmod 6\:.\ $ $\rm {-}1 + 2 \equiv 1\: $ is coprime to $6$ but $1 + 2 \equiv 3$ isn't.

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.