OFFSET
1,1
COMMENTS
From Robert Israel, Nov 22 2015: (Start)
a(14) > 3^1000 - 2 if it exists.
One of a(n), a(n)+2 and a(n)-2 must be a power of 3. (End)
EXAMPLE
81 is in this sequence because 81 - 2 = 79, 81 and 81 + 2 = 83 are all prime powers.
MAPLE
ispp:= proc(x) local p, r;
if isprime(x) then return true fi;
p:= 2;
do
r:= iroot(x, p);
if r^p = x then return isprime(r) fi;
if r < 2 then return false fi;
p:= nextprime(p);
od:
end proc:
ispp(1):= true:
A:= NULL;
for n from 1 to 1000 do
B:= map(ispp, [3^n-4, 3^n-2, 3^n+2, 3^n+4]);
if B[1] and B[2] then A:= A, 3^n-2 fi;
if B[2] and B[3] then A:= A, 3^n fi;
if B[3] and B[4] then A:= A, 3^n+2 fi;
od:
A; # Robert Israel, Nov 22 2015
MATHEMATICA
Prepend[Select[Range@ 100000, AllTrue[{# - 2, #, # + 2}, PrimePowerQ] &], 3] (* Michael De Vlieger, Dec 03 2015, Version 10 *)
PROG
(Magma) [n: n in [5..100000] | IsPrimePower(n-2) and IsPrimePower(n) and IsPrimePower(n+2)];
(PARI) is(k) = isprimepower(k) || k==1;
for(k=1, 1e6, if(is(k) && is(k+2) && is(k-2), print1(k, ", "))) \\ Altug Alkan, Nov 22 2015
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Juri-Stepan Gerasimov, Nov 22 2015
EXTENSIONS
a(12) and a(13) from Robert Israel, Nov 22 2015
STATUS
approved