OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[n_] := For[k = 1, True, k++, p = Prime[n]; If[PrimeQ[k*2*p^2 + 1], Return[k]]]; Table[ a[n] , {n, 1, 83}] (* Jean-François Alcover, Apr 12 2013 *)
sk[n_]:=Module[{k=1}, While[!PrimeQ[2*k*n^2+1], k++]; k]; Table[sk[n], {n, Prime[ Range[ 90]]}] (* Harvey P. Dale, Sep 22 2019 *)
PROG
(PFGW & SCRIPTIFY)
SCRIPT
DIM k
DIM i, 0
DIM q
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL a
SET i, i+1
IF i>10000 THEN END
SET k, 0
LABEL b
SET k, k+1
SETS t, %d, %d, %d\,; k; i; p(i)
SET q, k*2*p(i)^2+1
PRP q, t
IF ISPRP THEN WRITE myf, t
IF ISPRP THEN GOTO a
GOTO b
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 08 2013
STATUS
approved