OFFSET
1,2
FORMULA
a(n) = A064151(n) - A003604(n). Add 1 for n = 2 since 2! is prime. - Jens Kruse Andersen, Jul 29 2014
EXAMPLE
There are 45 primes between 4! = 24 and 4^4 = 256.
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Derek Orr, Dec 30 2013
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
STATUS
approved