Twin Primes

A Math oriented question asked at a recent Amazon interview.

Q : Given any twin prime pair, prove that the number between the twin primes is always divisible by 6.

Twin Prime (from Wiipedia) :

A twin prime is a prime number that differs from another prime number by two. Except for the pair (2, 3), this is the smallest possible difference between two primes. Some examples of twin prime pairs are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), ... (821, 823), etc. Sometimes the term twin prime is used for a pair of twin primes; an alternative name for this is prime twin.

4 comments:

anonymouse said...

This is actually more simple that it looks.

Since the numbers are prime, they are odd.

Therefore the number in between HAS to be even and divisible by 2.

Given 3 consecutive numbers, one of them has to be divisible by 3.

Since we are considering twin prime numbers, both the prime numbers are indivisible by 3, thus making a number in between divisible by 3.

If a number is divisible by 2 and 3, it is divisible by 6. :-)

If a mathematical proof is required, we can use induction.

anonymouse said...

The only exception to this rule is the first pair of twin primes, which is (3,5) since both the numbers are < 6

Unknown said...

Absolutely @SV.

About proof by Induction - can you give it a try . I was not able to come up with a "N+1" case.

Travelling guider said...

The game of satta matka, also known as paigam paisa, boasts a rich history and is practiced around the world today. In the Indian subcontinent, it’s the most popular gambling game in existence today. Because it’s all about probability, there are winners and losers, but you can increase your chances of winning by studying satta matka strategy and understanding how satta matka systems work. Keep reading to learn more about how to win at satta matka!SATTA MATKA RESULT

 
Stats