All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Getting Primed With Subtraction And Addition (Posted on 2007-12-26)
Determine all possible primes p such that each of p-8, p-4, p+8 and p+12 are also primes.

 See The Solution Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer exploration (spoiler) | Comment 1 of 5

The P in the following program is 8 lower than the p of the puzzle, and tests P+4, P+8 (the original p of the puzzle), P+16 and P+20 for primality, and finds only P=3 (puzzle's original p=11) when testing all P through 131,708,999, at which point it was manually interrupted.

`list   10   loop   15    Pp=P   20    P=nxtprm(P)   30    if prmdiv(P+4)=P+4 then   40      :if prmdiv(P+8)=P+8 then   50          :if prmdiv(P+16)=P+16 then   60              :if prmdiv(P+20)=P+20 then   70                  :print P;P+4;P+8;P+16;P+20   75   if P=0 then goto 100   80   endloop  100   print PpOKasave "5primes"OKrun 3  7  11  19  23Break in 20?p,pp 131709001       131708999OK`

 Posted by Charlie on 2007-12-26 11:59:39

 Search: Search body:
Forums (0)