OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[n_] := For[p = Prime[n]; j = 1, j < 10^6, j++, If[PrimeQ[q = j*2*p^3 - 1] && PrimeQ[j*p*2*q^2 - 1], Return[j]]]; Table[a[n], {n, 1, 75}] (* Jean-François Alcover, Apr 22 2013 *)
PROG
(PFGW & SCRIPTIFY)
SCRIPT
DIM n, 1
DIM j
DIM q
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL a
SET n, n+1
SET j, 0
LABEL b
SET j, j+1
SET q, j*2*p(n)^3-1
SETS t, %d\,; p(n)
PRP q, t
IF ISPRP THEN GOTO c
GOTO b
LABEL c
SET q, j*2*p(n)*q^2-1
PRP q, t
IF ISPRP THEN GOTO d
GOTO b
LABEL d
WRITE myf, t
GOTO a
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 12 2013
STATUS
approved