OFFSET
1,1
COMMENTS
A generalization of A014574.
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
FORMULA
{2} UNION A088071. - R. J. Mathar, Aug 07 2008
EXAMPLE
10 is in the sequence because both 9 and 11 are prime powers; 26 is in the sequence because both 25 and 27 are prime powers.
MAPLE
with(numtheory): a:=proc(n) if nops(factorset(n-1))*nops(factorset(n+1))=1 then n else fi end: 2, seq(a(n), n=2..1500); # Emeric Deutsch, Jul 23 2006
MATHEMATICA
Insert[Select[Range[3, 3000], Length[FactorInteger[ # - 1]] == Length[ FactorInteger[ # + 1]] == 1 &], 2, 1] (* Stefan Steinerberger, Jul 23 2006 *)
Join[{2}, Select[Range[1100], And @@ PrimePowerQ /@ {# - 1, # + 1} &]] (* Ivan Neretin, Nov 24 2016 *)
PROG
(Magma) [2] cat [n : n in [3..1110] | IsPrimePower(n-1) and IsPrimePower(n+1)]; // Vincenzo Librandi, Nov 25 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Greg Huber, Jul 13 2006
EXTENSIONS
STATUS
approved