OFFSET
4,2
COMMENTS
Search set similar to A212037 but the sign of k in the prime form is switched.
Heuristically the average of a(n)/n for n=1 to N tends to 1 as N increases.
LINKS
Pierre CAMI, Table of n, a(n) for n = 4..825
MAPLE
A212038 := proc(n)
local a, k, p ;
a := 0 ;
for k from 0 do
p := (2^n-k)*2^n-1 ;
if isprime(p) then
a := a+1 ;
end if;
if isprime(p) and isprime(p+2) then
return a;
end if;
end do:
end proc: # R. J. Mathar, Jul 21 2012
PROG
(PFGW)
SCRIPT
DIM nn, 3
DIM jj
DIM kk
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn>825 THEN END
SET kk, -1
SET jj, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP (2^nn-kk)*2^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
SET jj, jj+1
PRP (2^nn-kk)*2^nn+1, tt
IF ISPRP THEN GOTO d
IF ISPRIME THEN GOTO d
GOTO loopk
LABEL d
SETS tt, %d, %d\,; nn; jj
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 14 2012
STATUS
approved