cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A120432 Numbers n such that n-1 and n+1 are prime powers.

This page as a plain text file.
%I A120432 #17 Sep 08 2022 08:45:26
%S A120432 2,3,4,6,8,10,12,18,24,26,28,30,42,48,60,72,80,82,102,108,126,138,150,
%T A120432 168,180,192,198,228,240,242,270,282,312,348,360,420,432,462,522,570,
%U A120432 600,618,642,660,728,810,822,828,840,858,882,1020,1032,1050,1062,1092
%N A120432 Numbers n such that n-1 and n+1 are prime powers.
%C A120432 A generalization of A014574.
%H A120432 Ivan Neretin, <a href="/A120432/b120432.txt">Table of n, a(n) for n = 1..10000</a>
%F A120432 {2} UNION A088071. - _R. J. Mathar_, Aug 07 2008
%e A120432 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.
%p A120432 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
%t A120432 Insert[Select[Range[3, 3000], Length[FactorInteger[ # - 1]] == Length[ FactorInteger[ # + 1]] == 1 &], 2, 1] (* _Stefan Steinerberger_, Jul 23 2006 *)
%t A120432 Join[{2}, Select[Range[1100], And @@ PrimePowerQ /@ {# - 1, # + 1} &]] (* _Ivan Neretin_, Nov 24 2016 *)
%o A120432 (Magma) [2] cat [n : n in [3..1110] | IsPrimePower(n-1) and  IsPrimePower(n+1)]; // _Vincenzo Librandi_, Nov 25 2016
%Y A120432 Cf. A000961, A014574.
%K A120432 nonn
%O A120432 1,1
%A A120432 _Greg Huber_, Jul 13 2006
%E A120432 More terms from _Emeric Deutsch_, _Stefan Steinerberger_ and _Ryan Propper_, Jul 23 2006