OFFSET
1,2
COMMENTS
Note that only first k for which 3*prime(n)*2^k - 1 is prime is used to test whether 3*prime(n)*2^k + 1 is prime.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..6836
EXAMPLE
3*prime(1)*2^1-1=11 prime,13 prime so a(1)=1
3*prime(2)*2^1-1=17 prime,19 prime so a(2)=2
3*prime(3)*2^1-1=29 prime,31 prime so a(3)=3
3*prime(4)*2^1-1=41 prime,43 prime so a(4)=4
3*prime(5)*2^1-1=65 composite
3*prime(5)*2^2-1=131 prime,133 composite
3*prime(6)*2^1-1=77 composite
3*prime(6)*2^2-1=155 composite
3*prime(6)*2^3-1=311 prime,313 prime so a(5)=6
MATHEMATICA
t = {}; Do[p = Prime[n]; k = 1; While[! PrimeQ[3*p*2^k - 1], k++]; If[PrimeQ[3*p*2^k + 1], AppendTo[t, n]], {n, 224}]; t (* T. D. Noe, Feb 29 2012 *)
PROG
PFGW64 from Primeform group and SCRIPTIFY
Command pfgw64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk
DIMS tt
OPENFILEOUT myfile, k.txt
LABEL loopn
SET nn, nn+1
IF nn>50000 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP 3*p(nn)*2^kk-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP 3*p(nn)*2^kk+1, tt
IF ISPRP THEN GOTO b
IF ISPRIME THEN GOTO b
GOTO loopn
LABEL b
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Feb 25 2012
STATUS
approved