OFFSET
1,1
COMMENTS
Let 240*k*p(n)+1 = prime R, 6*k*p(n)*R+1 = prime Q, and 40*Q+1 = prime P.
P=(240*k*p(n))^2+240*k*p(n)+41=x^2+x+41 with x=240*k*p(n)
As R and Q are provable primes so is P a provable prime of the Euler polynomial x^2+x+41.
The only 0 is for p(13)=41 as R is always composite except for k=0 then P and Q are unity.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..3500
David Broadhurst, A 132738-digit prime of the form x^2+x+41, Aug 14 2012 (archive of the nmbrthry mailing list).
EXAMPLE
240*11*2+1=5281 prime, 6*11*2*5281+1=697093 prime, (240*11*2)^2+(240*11*2)+41=27883721 prime. p(1)=2 so k(1)=11.
MATHEMATICA
a[n_] := (Clear[k]; p = Prime[n]; R = 240*k*p + 1; Q = 6*k*p*R + 1; P = 40*Q + 1; If[FactorList[P][[1, 1]] > 1, Return[0], For[k = 1, True, k++, If[PrimeQ[P] && PrimeQ[Q] && PrimeQ[R], Return[k]]]]); Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Sep 10 2012 *)
PROG
PFGW and SCRYPTIFY
SCRIPT
DIM nn
DIM kk
DIM rr
DIM qq
DIM pp
DIMS tt
OPENFILEOUT myf, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn==13 THEN SET nn, 14
IF nn>3500 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SET rr, 240*(kk*p(nn))+1
SETS tt, %d\,; kk
PRP rr, tt
IF ISPRP THEN GOTO a
GOTO loopk
LABEL a
SET qq, 6*(kk*mm)*rr+1
PRP qq, tt
IF ISPRP THEN GOTO b
GOTO loopk
LABEL b
SET pp, 40*qq+1
PRP pp, tt
IF ISPRP THEN GOTO c
GOTO loopk
LABEL c
WRITE myf, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 29 2012
STATUS
approved