A120432 Numbers n such that n-1 and n+1 are prime powers.
2, 3, 4, 6, 8, 10, 12, 18, 24, 26, 28, 30, 42, 48, 60, 72, 80, 82, 102, 108, 126, 138, 150, 168, 180, 192, 198, 228, 240, 242, 270, 282, 312, 348, 360, 420, 432, 462, 522, 570, 600, 618, 642, 660, 728, 810, 822, 828, 840, 858, 882, 1020, 1032, 1050, 1062, 1092
Offset: 1
Keywords
Examples
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.
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[2] cat [n : n in [3..1110] | IsPrimePower(n-1) and IsPrimePower(n+1)]; // Vincenzo Librandi, Nov 25 2016
-
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 *)
Formula
{2} UNION A088071. - R. J. Mathar, Aug 07 2008
Comments