Google interview question

Rather than prove it I would simply note that it is NOT TRUE! p= 2 is a prime number but p^2- 1= 3 is NOT divisible by 24. p= 3 is a prime number but p^2- 1= 8 is NOT divisible by 24.
 
Rather than prove it I would simply note that it is NOT TRUE! p= 2 is a prime number but p^2- 1= 3 is NOT divisible by 24. p= 3 is a prime number but p^2- 1= 8 is NOT divisible by 24.
They forgot to add the constraint P > 3
 
p^2 - 1 = (p-1)(p+1)

knowing that 2 and 3 don't divide p

p=2k+1,
Therefore both (p-1) and (p+1) divide 2. So p^2 - 1=(p-1)(p+1) divide 4

p= 3l + r, 1<=r<=2
Therefore either (p-1) or (p+1) divide 3. So p^2 - 1=(p-1)(p+1) divide 3.
 
...

That was almost finished but still not completely...

p = r mod 8 (0<= r < 8)

p isn't odd. Therefore r can' be only 1, 3, 5, 7

Or
3*3 = 9 = 1 mod 8
5*5 = 25 = 1 mod 8
7*7 = (-1) * (-1) mod 8 = 1 mod 8

Therefore
p*p = 1 mod 8

(p*p - 1) divide 8
 
Top