login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A060846
Smallest prime > a nontrivial power of a prime.
3
5, 11, 11, 17, 29, 29, 37, 53, 67, 83, 127, 127, 131, 173, 251, 257, 293, 347, 367, 521, 541, 631, 733, 853, 967, 1031, 1361, 1373, 1693, 1861, 2053, 2203, 2203, 2213, 2411, 2819, 3137, 3491, 3727, 4099, 4493, 4919, 5051, 5333, 6247, 6563, 6863, 6899, 7927
OFFSET
1,1
FORMULA
a(n) = nextprime(A025475(n+1)) = A007918(A025475(n+1)) = Min{p| p>A025475(n+1)}. [corrected by Michel Marcus, Aug 24 2019]
EXAMPLE
78125=5^7 is followed by 78137.
PROG
(PARI) ispp(x) = !isprime(x) && isprimepower(x);
lista(nn) = apply(x->nextprime(x), select(x->ispp(x), [1..nn])); \\ Michel Marcus, Aug 24 2019
(Python)
from sympy import primepi, integer_nthroot, nextprime
def A060846(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return int(n+x-sum(primepi(integer_nthroot(x, k)[0]) for k in range(2, x.bit_length())))
return nextprime(bisection(f, n, n)) # Chai Wah Wu, Sep 15 2024
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, May 03 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 14:16 EDT 2024. Contains 376178 sequences. (Running on oeis4.)