OFFSET
1,5
COMMENTS
Conjecture: there is always at least one k>=0 unless n=3.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..826
MAPLE
A205322 := proc(n)
local a, p ;
for a from 0 to 2^n do
p := (2^n-a)*2^n-1 ;
if isprime(p) and isprime(p+2) then
return a;
end if;
end do:
return -1 ;
end proc: # R. J. Mathar, Jul 18 2012
MATHEMATICA
Table[k = -1; While[k++; p = 4^n - k*2^n - 1; p > 0 && ! (PrimeQ[p] && PrimeQ[p + 2])]; If[p <= 0, -1, k], {n, 50}] (* T. D. Noe, Mar 15 2013 *)
PROG
(PFGW64 and SCRIPTIFY)
SCRIPT
DIM nn, 0
DIM kk
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn==3 THEN SET nn, 4
IF nn>826 THEN END
SET kk, -1
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
PRP (2^nn-kk)*2^nn+1, tt
IF ISPRP THEN GOTO d
IF ISPRIME THEN GOTO d
GOTO loopk
LABEL d
WRITE myfile, tt
GOTO loopn
CROSSREFS
KEYWORD
sign
AUTHOR
Pierre CAMI, Jul 14 2012
STATUS
approved