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.

Original entry on oeis.org

1, 2, 28, 80, 82, 126, 242, 728, 2400, 3374, 6562, 6858, 14640, 19682, 24390, 28560, 29790, 50626, 50652, 59050, 91126, 161052, 194480, 194482, 250048, 274626, 300762, 328510, 357912, 371292, 571788, 707280, 753570, 759376, 823542, 970298, 1157626, 1295028, 1442898, 1771560, 1860868, 2146688, 2146690
Offset: 1

Views

Author

S. Brunner, Nov 17 2019

Keywords

Comments

If 0 or 1 are not counted as powers, then this sequence starts with 28.
All terms other than 1 are even and follow or precede an odd power.

Examples

			The first 20 terms with their neighbors:
   n  k-1   k   k+1      |       n   k-1    k    k+1
   1  0^3    1    2      |      11   3^8  6562  6563
   2  1^3    2    3      |      12  6857  6858  19^3
   3  3^3   28   29      |      13 14639 14640  11^4
   4   79   80  3^4      |      14 19681 19682   3^9
   5  3^4   82   83      |      15  29^3 24390 24391
   6  5^3  126  127      |      16 28559 28560  13^4
   7  241  242  3^5      |      17 29789 29790  31^3
   8  727  728  3^6      |      18  15^4 50626 50627
   9 2399 2400  7^4      |      19 50651 50652  37^3
  10 3373 3374 15^3      |      20  3^10 59050 59051
		

Crossrefs

Programs

  • Mathematica
    {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 *)
  • 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