Prime Number puzzle

Consider all prime number pairs separated by just one number (like <5,7>, <11,13>….etc). We can clearly observe that the number in between is divisible is 6.

Can we prove that this is always be true for any pair of prime numbers.

Solution :
Let the prime numbers be n, n+2. Our case is to prove n+1 is divisible by 6, ie n+1 is divisible by 2 and 3.

In this case – since n is prime, it will be odd – so we can easily say n+1 will be even, divisible by 2

Next is to prove it is divisible by 3 as well. This proved to be baffling for me.

Later realized – for any 3 consecutive numbers, atleast one of them should always be divisible by 3. This is true for any 3 consecutive numbers as multiples of 3 repeat at that interval.

So definitely one of n,n+1,n+2 should be divisible by 3. Since n and n+2 are prime – they cannot be multiples of 3 – so n+1 should be a multiple of 3.

Doctor puzzle

I was recently given this puzzle in a interview discussion

A patient is given 2 vials of tablets labeled A & B. He has to take one tablet from each vial daily. Neither can he skip nor can he take overdose – as these would prove fatal.

One day – aftert taking one tablet from vial A, 2 fall from vial B. Now he has 1A and 2Bs. By a clever logic – he manages to avoid overdose even though there is no way to differentiate the tablets to be from A or B. They are same in color, texture, size, appearance etc etc.

Solution : (Thanks to the interviewer who patiently helped me with some clues)

He divides the tablets into halves. He gets 2 pieces of each. After this he consumes one half of this ==>

1/2B + 1/2B + 1/2A = 1B + 1/2A. To avoid under dosage – he takes a new tablet from vial A, consumes half of it. The remaining half of this A and the remnants from breaking done in step before, are preserved and he uses them for the next day 🙂

Clever 🙂