[go: up one dir, main page]

login
A264734
Prime powers k such that k - 2 and k + 2 are prime powers.
2
3, 5, 7, 9, 11, 25, 27, 29, 81, 241, 59051, 450283905890997361, 36472996377170786401
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
EXTENSIONS
a(12) and a(13) from Robert Israel, Nov 22 2015
STATUS
approved