Globaltech Research Interview Question
Software Engineer / Developersi m not sure if the argument is correct bcos P & P^2 + 8 is not prime even in case of P=5,
infact ur argument "We take 2 in this case. So, it makes (p^3+2^4) a prime....this cannot be factored furthur" is leading to the generalization that we can have even P^3 + 2^n as prime, so i m not sure if it is the correct way of proving.....
Any prime integer p can be written as 6k+1 or 6k-1, except 2,3.
when p!=2,3 then..ie p=6k(+/-)1
p^2+8 = 36k^2 (+/-) 12k + 9
...... this is a multiple of 3 n also greater than 8 and hence cannot be prime if p!=2,3...!
if p=2... p^2+8 cannot be prime obviously..
that leaves us with p=3 case..
p^2+8 = 17 (prime)
p^3+16 = 43 (prime) n proved!!!
We know that p is surely an odd number there p^2 when divided by 3 must leave a remainder 1.(obviously it cant have remainder 0 ;it would be multiple of 3 ( here I m not considering case p=3)and not even two it can be shown easily by letting the number of form 3k+r where r=1,2)
Now we know p^2=3m+1 so p^2+8=3m+9 =3(m+3) so it isnt prime
Now all cases have been rejected except for p=3; p^2+8=17 and p^3+16=43 .
So done p=3 satisfies it and that's the only answer:)
p & p^2+8 are primes, if p not equal to 2.
- oxygen August 13, 2007p*(p^2 + 8) is not prime as it is factored into prime numbers......(p^3+p*8)
To make it prime, we need to convert p*8 into something not divisble by p,
We take 2 in this case. So, it makes (p^3+2^4) a prime....this cannot be factored furthur.
Can someone comment on the solution ?