OFFSET
1,2
COMMENTS
Conjecture : there is always one such k for each n>0.
Heuristically, as N increases, the average of a(n)/n^2 for n=1 to N tends to 1.2
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..500
MAPLE
A214496 := proc(n)
local k;
for k from 1 do
p := (3^n+k)*3^n-1 ;
if isprime(p) and isprime(p+2) then
return k;
end if;
end do:
end proc: # R. J. Mathar, Jul 23 2012
PROG
(PFGW64 and SCRIPTIFY)
SCRIPT
DIM nn, 0
DIM kk
DIM jj
DIMS tt
OPENFILEOUT myfile, a(n).txt
OPENFILEOUT myf, b(n).txt
LABEL loopn
SET nn, nn+1
SET jj, 0
IF nn>500 THEN END
SET kk, -1
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP (3^nn+kk)*3^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
SET jj, jj+1
PRP (3^nn+kk)*3^nn+1, tt
IF ISPRP THEN GOTO d
IF ISPRIME THEN GOTO d
GOTO loopk
LABEL d
WRITE myfile, tt
SETS tt, %d, %d\,; nn; jj
WRITE myf, tt
GOTO loopn
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 20 2012
STATUS
approved