login
A215055
Smallest k>0 such that 2*k*3^n-1 and 3^n-2*k are both prime and n>1
1
1, 2, 4, 2, 14, 17, 5, 37, 10, 10, 29, 25, 110, 125, 55, 143, 28, 10, 277, 37, 5, 67, 14, 800, 241, 68, 551, 53, 133, 142, 61, 203, 131, 742, 245, 235, 5, 152, 20, 70, 248, 730, 382, 562, 199, 158, 199, 157, 236, 545, 334, 100, 5, 913, 782, 205, 809, 85, 106, 995
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
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
Sequence in context: A062867 A264027 A113539 * A152877 A071353 A134763
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 01 2012
STATUS
approved