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.

This page as a plain text file.
%I A229836 #53 Mar 01 2025 17:44:22
%S A229836 0,2,6,45,415,4693,65010,1073640,20669837,454793822,11259684418,
%T A229836 309761863916,9373389023182,309374515194621,11059527891811334,
%U A229836 425655578031419604,17547665070746310736,771403345825446116583,36020103485009885093324
%N A229836 Number of primes between n! and n^n inclusive.
%F A229836 a(n) = A064151(n) - A003604(n). Add 1 for n = 2 since 2! is prime. - _Jens Kruse Andersen_, Jul 29 2014
%e A229836 There are 45 primes between 4! = 24 and 4^4 = 256.
%p A229836 with(numtheory): A229836:=n->pi(n^n)-pi(n!): (0,2,seq(A229836(n), n=3..10)); # _Wesley Ivan Hurt_, Nov 17 2015
%t A229836 Join[{0, 2}, Table[PrimePi[n^n] - PrimePi[n!], {n, 3, 12}]] (* _Wesley Ivan Hurt_, Nov 17 2015 *)
%o A229836 (Python)
%o A229836 import math
%o A229836 import sympy
%o A229836 from sympy import sieve
%o A229836 x = 1
%o A229836 while x < 50:
%o A229836     y = [i for i in sieve.primerange(math.factorial(x),x**x)]
%o A229836     print(len(y))
%o A229836     x += 1
%o A229836 (Python)
%o A229836 from math import factorial
%o A229836 from sympy import primepi
%o A229836 def A229836(n): return primepi(n**n)-primepi(factorial(n)-1) # _Chai Wah Wu_, Jun 06 2024
%o A229836 (PARI) a(n)=primepi(n^n)-primepi(n!-1) \\ _Charles R Greathouse IV_, Apr 30 2014
%o A229836 (PARI) a(n) = if(n==2, 2, primepi(n^n)-primepi(n!)) \\ _Altug Alkan_, Nov 17 2015
%Y A229836 Cf. A000142, A000312, A003604, A064151.
%K A229836 nonn,more
%O A229836 1,2
%A A229836 _Derek Orr_, Dec 30 2013
%E A229836 a(12)-a(16) from _Jens Kruse Andersen_, Jul 29 2014
%E A229836 a(17)-a(18) from _Chai Wah Wu_, Jun 06 2024
%E A229836 a(19) from _Amiram Eldar_, Jun 11 2024