OFFSET
2,1
COMMENTS
Q= x^2 + x + p(n) with x = k*p(n+1)*(p(n)-1), a polynomial prime.
LINKS
Pierre CAMI, Table of n, a(n) for n = 2..10001
MATHEMATICA
snk[n_]:=Module[{pr=Prime[n], pr1=Prime[n+1], k=1, p, q, r}, p=k*pr1*(pr-1)+1; q=k*pr1*p+1; r=(pr-1)*q+1; While[!AllTrue[{p, q, r}, PrimeQ], k++; p=k*pr1*(pr-1)+1; q=k*pr1*p+1; r=(pr-1)*q+1; ]; k]; Array[snk, 50, 2] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 09 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i
DIM j
DIM k
DIM n, 1
OPENFILEOUT myf, a(n)
LABEL loop1
SET n, n+1
SET k, 0
SET i, p(n)-1
SET j, p(n+1)
LABEL loop2
SET k, k+2
PRP k*i*j+1
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
PRP k*j*(k*i*j+1)+1
IF ISPRP THEN GOTO b
GOTO loop2
LABEL b
PRP i*(k*j*(k*i*j+1)+1)+1
IF ISPRP THEN GOTO c
GOTO loop2
LABEL c
WRITE myf, k
GOTO loop1
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Sep 17 2014
STATUS
approved