OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..2000
EXAMPLE
2^1+5*2^1-1=11 11 and 13 twin primes so a(1)=5.
2^2+7*2^1-1=17 17 and 19 twin primes so a(2)=7.
2^3+13*2^2-1=59 59 and 61 twin primes so a(3)=13.
PROG
PFGW64 from Primeform group and SCRIPTIFY
SCRIPT
DIM nn, 0
DIM mm
DIM kk
DIMS tt
OPENFILEOUT myfile, twins.txt
LABEL loopn
SET nn, nn+1
IF nn>2000 THEN END
SET kk, 2
LABEL loopk
SET kk, kk+1
SET mm, nn/3
LABEL loopm
SET mm, mm+1
IF mm>nn THEN GOTO loopk
SETS tt, %d, %d, %d, %d\ ; nn; kk; p(kk); mm
PRP 2^nn+p(kk)*2^mm-1, tt
IF ISPRIME THEN GOTO a
IF ISPRP THEN GOTO a
GOTO loopm
LABEL a
PRP 2^nn+p(kk)*2^mm+1, tt
IF ISPRIME THEN GOTO b
IF ISPRP THEN GOTO b
GOTO loopm
LABEL b
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 26 2012
STATUS
approved