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.

A329595 Numbers k such that either (a) k-1=i^m for some i and m >= 3 and k+1 is a prime, or (b) k-1 is a prime and k+1 = i^m for some i and m >= 3.

This page as a plain text file.
%I A329595 #34 Jan 26 2020 12:42:36
%S A329595 1,2,28,80,82,126,242,728,2400,3374,6562,6858,14640,19682,24390,28560,
%T A329595 29790,50626,50652,59050,91126,161052,194480,194482,250048,274626,
%U A329595 300762,328510,357912,371292,571788,707280,753570,759376,823542,970298,1157626,1295028,1442898,1771560,1860868,2146688,2146690
%N A329595 Numbers k such that either (a) k-1=i^m for some i and m >= 3 and k+1 is a prime, or (b) k-1 is a prime and k+1 = i^m for some i and m >= 3.
%C A329595 If 0 or 1 are not counted as powers, then this sequence starts with 28.
%C A329595 All terms other than 1 are even and follow or precede an odd power.
%H A329595 S. Brunner, <a href="/A329595/b329595.txt">Table of n, a(n) for n = 1..1100</a>
%e A329595 The first 20 terms with their neighbors:
%e A329595    n  k-1   k   k+1      |       n   k-1    k    k+1
%e A329595    1  0^3    1    2      |      11   3^8  6562  6563
%e A329595    2  1^3    2    3      |      12  6857  6858  19^3
%e A329595    3  3^3   28   29      |      13 14639 14640  11^4
%e A329595    4   79   80  3^4      |      14 19681 19682   3^9
%e A329595    5  3^4   82   83      |      15  29^3 24390 24391
%e A329595    6  5^3  126  127      |      16 28559 28560  13^4
%e A329595    7  241  242  3^5      |      17 29789 29790  31^3
%e A329595    8  727  728  3^6      |      18  15^4 50626 50627
%e A329595    9 2399 2400  7^4      |      19 50651 50652  37^3
%e A329595   10 3373 3374 15^3      |      20  3^10 59050 59051
%t A329595 {1, 2}~Join~Flatten@ Map[Which[AllTrue[{#2, #3}, # > 2 &], #1 + {-1, 1}, #2 > 2, #1 - 1, #3 > 2, #1 + 1, True, Nothing] & @@ Prepend[Map[GCD @@ FactorInteger[#][[All, -1]] &, {# - 2, # + 2}], #] &, Prime@ Range[160000]] (* _Michael De Vlieger_, Dec 27 2019 *)
%o A329595 (PARI) isok(k) = (k==1) || (k==2) || ((ispower(k-1) >= 3) && isprime(k+1)) || (isprime(k-1) && (ispower(k+1) >= 3)); \\ _Michel Marcus_, Nov 18 2019
%Y A329595 Cf. A163492, A329582.
%K A329595 nonn
%O A329595 1,2
%A A329595 _S. Brunner_, Nov 17 2019