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.

A264734 Prime powers k such that k - 2 and k + 2 are prime powers.

This page as a plain text file.
%I A264734 #28 Sep 08 2022 08:46:14
%S A264734 3,5,7,9,11,25,27,29,81,241,59051,450283905890997361,
%T A264734 36472996377170786401
%N A264734 Prime powers k such that k - 2 and k + 2 are prime powers.
%C A264734 From _Robert Israel_, Nov 22 2015: (Start)
%C A264734 a(14) > 3^1000 - 2 if it exists.
%C A264734 One of a(n), a(n)+2 and a(n)-2 must be a power of 3. (End)
%e A264734 81 is in this sequence because 81 - 2 = 79, 81 and 81 + 2 = 83 are all prime powers.
%p A264734 ispp:= proc(x) local p, r;
%p A264734   if isprime(x) then return true fi;
%p A264734   p:= 2;
%p A264734   do
%p A264734      r:= iroot(x,p);
%p A264734      if r^p = x then return isprime(r) fi;
%p A264734      if r < 2 then return false fi;
%p A264734      p:= nextprime(p);
%p A264734   od:
%p A264734 end proc:
%p A264734 ispp(1):= true:
%p A264734 A:= NULL;
%p A264734 for n from 1 to 1000 do
%p A264734   B:= map(ispp, [3^n-4,3^n-2,3^n+2,3^n+4]);
%p A264734   if B[1] and B[2] then A:= A, 3^n-2 fi;
%p A264734   if B[2] and B[3] then A:= A, 3^n fi;
%p A264734   if B[3] and B[4] then A:= A, 3^n+2 fi;
%p A264734 od:
%p A264734 A; # _Robert Israel_, Nov 22 2015
%t A264734 Prepend[Select[Range@ 100000, AllTrue[{# - 2, #, # + 2}, PrimePowerQ] &], 3] (* _Michael De Vlieger_, Dec 03 2015, Version 10 *)
%o A264734 (Magma) [n: n in [5..100000] | IsPrimePower(n-2) and IsPrimePower(n) and IsPrimePower(n+2)];
%o A264734 (PARI) is(k) = isprimepower(k) || k==1;
%o A264734 for(k=1, 1e6, if(is(k) && is(k+2) && is(k-2), print1(k, ", "))) \\ _Altug Alkan_, Nov 22 2015
%Y A264734 Cf. A000961, A144234, A264744.
%K A264734 nonn,more
%O A264734 1,1
%A A264734 _Juri-Stepan Gerasimov_, Nov 22 2015
%E A264734 a(12) and a(13) from _Robert Israel_, Nov 22 2015