OFFSET
1,1
COMMENTS
Perfect powers (A001597) are 1 and numbers with a proper integer root.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The prime after 13 is 17, and the interval (13,14,15,16,17) contains only one perfect power 16, so 13 is in the sequence.
MAPLE
N:= 10^4: # to get all entries <= N
S:={seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))}:
S:= sort(convert(S, list)):
J:= select(i -> nextprime(S[i]) < S[i+1] and prevprime(S[i]) > S[i-1], [$2..nops(S)-1]):
J:= [1, op(J)]:
map(prevprime, S[J]); # Robert Israel, Jan 19 2025
MATHEMATICA
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All, 2]]>1;
Select[Range[1000], PrimeQ[#]&&Length[Select[Range[#, NextPrime[#]], perpowQ]]==1&]
PROG
(PARI) is_a379154(n) = isprime(n) && #select(x->ispower(x), [n+1..nextprime(n+1)-1])==1 \\ Hugo Pfoertner, Dec 19 2024
CROSSREFS
The indices of these primes are one plus the positions of 1 in A377432.
For zero instead of one perfect power we have the primes indexed by A377436.
The indices of these primes are A377434.
For previous instead of next prime we have A378364.
A081676 gives the greatest perfect power <= n.
A116086 gives perfect powers with no primes between them and the next perfect power.
A377468 gives the least perfect power > n.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 18 2024
STATUS
approved