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.

A060846 Smallest prime > the n-th nontrivial power of a prime.

Original entry on oeis.org

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

Views

Author

Labos Elemer, May 03 2001

Keywords

Examples

			78125=5^7 is followed by 78137.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[Select[Range[10^4], !PrimeQ[#] && PrimePowerQ[#] &]] (* Amiram Eldar, Oct 04 2024 *)
  • 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

Formula

a(n) = nextprime(A025475(n+1)) = A007918(A025475(n+1)) = Min{p| p>A025475(n+1)}. [corrected by Michel Marcus, Aug 24 2019]