login
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.
2
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,2
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.
EXAMPLE
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
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 *)
PROG
(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
CROSSREFS
Sequence in context: A245801 A296245 A156471 * A138964 A200040 A334696
KEYWORD
nonn
AUTHOR
S. Brunner, Nov 17 2019
STATUS
approved