OFFSET
1,2
COMMENTS
a(10) = 7^48. If it exists, a(11) > 10^100. - Giovanni Resta, Apr 12 2016
EXAMPLE
6561 is in this sequence because 6561 = 3^8, 6561 - 8 = 6553 is prime and 6561 + 8 = 6569 is prime.
MATHEMATICA
nn = 10^6; {1}~Join~Sort@ Apply[Power, Select[Flatten[Function[k, {#, k}] /@ Range[Floor@ Log[#, nn]] & /@ Prime@ Range@ PrimePi@ nn, 1], With[{p = First@ #, k = Last@ #}, And[Or[PrimePowerQ@ #, # == 1] &[p^k - k], Or[PrimePowerQ@ #, # == 1] &[p^k + k]]] &], 1] (* Michael De Vlieger, Apr 06 2016 *)
PROG
(PARI) ispp(n) = (n==1) || isprimepower(n);
isok(n) = (n==1) || ((k=isprimepower(n)) && ispp(n+k) && ispp(n-k));
\\ Michel Marcus, Apr 07 2016
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Juri-Stepan Gerasimov, Apr 06 2016
EXTENSIONS
a(10) from Giovanni Resta, Apr 12 2016
STATUS
approved