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.

A229836 Number of primes between n! and n^n inclusive.

Original entry on oeis.org

0, 2, 6, 45, 415, 4693, 65010, 1073640, 20669837, 454793822, 11259684418, 309761863916, 9373389023182, 309374515194621, 11059527891811334, 425655578031419604, 17547665070746310736, 771403345825446116583, 36020103485009885093324
Offset: 1

Views

Author

Derek Orr, Dec 30 2013

Keywords

Examples

			There are 45 primes between 4! = 24 and 4^4 = 256.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A229836:=n->pi(n^n)-pi(n!): (0,2,seq(A229836(n), n=3..10)); # Wesley Ivan Hurt, Nov 17 2015
  • Mathematica
    Join[{0, 2}, Table[PrimePi[n^n] - PrimePi[n!], {n, 3, 12}]] (* Wesley Ivan Hurt, Nov 17 2015 *)
  • PARI
    a(n)=primepi(n^n)-primepi(n!-1) \\ Charles R Greathouse IV, Apr 30 2014
    
  • PARI
    a(n) = if(n==2, 2, primepi(n^n)-primepi(n!)) \\ Altug Alkan, Nov 17 2015
  • Python
    import math
    import sympy
    from sympy import sieve
    x = 1
    while x < 50:
        y = [i for i in sieve.primerange(math.factorial(x),x**x)]
        print(len(y))
        x += 1
    
  • Python
    from math import factorial
    from sympy import primepi
    def A229836(n): return primepi(n**n)-primepi(factorial(n)-1) # Chai Wah Wu, Jun 06 2024
    

Formula

a(n) = A064151(n) - A003604(n). Add 1 for n = 2 since 2! is prime. - Jens Kruse Andersen, Jul 29 2014

Extensions

a(12)-a(16) from Jens Kruse Andersen, Jul 29 2014
a(17)-a(18) from Chai Wah Wu, Jun 06 2024
a(19) from Amiram Eldar, Jun 11 2024