OFFSET
2,2
COMMENTS
3^n-2*k is the greatest prime q such that 9^n-q*3^n-1 is prime = 2*k*3^n-1
LINKS
Pierre CAMI, Table of n, a(n) for n = 2..500
MATHEMATICA
sk[n_]:=Module[{k=1, n3=3^n}, While[!PrimeQ[2k*n3-1]||!PrimeQ[n3-2k], k++]; k]; Array[sk, 70, 2] (* Harvey P. Dale, Oct 04 2016 *)
PROG
PFGW and SCRIPTIFY
SCRIPT
DIM nn, 1
DIM kk
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\ ; nn; kk
PRP 2*kk*3^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP 3^nn-2*kk, tt
IF ISPRP THEN GOTO b
IF ISPRIME THEN GOTO b
GOTO loopk
LABEL b
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 01 2012
STATUS
approved