A054272 Number of primes in the interval [prime(n), prime(n)^2].
2, 3, 7, 12, 26, 34, 55, 65, 91, 137, 152, 208, 251, 270, 315, 394, 471, 502, 591, 656, 685, 790, 864, 977, 1139, 1227, 1268, 1354, 1395, 1494, 1847, 1945, 2109, 2157, 2455, 2512, 2693, 2878, 3005, 3202, 3396, 3471, 3826, 3902, 4045, 4119, 4581, 5059
Offset: 1
Keywords
Examples
n=4, the zone in question is [7,49] and encloses a(4)=12 primes, as follows: {7,11,13,17,19,23,29,31,37,41,43,47}.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..5000
- Carlos Rivera, Conjecture 26. The Calendar-like square Conjecture, The Prime Puzzles and Problems Connection.
Crossrefs
Programs
-
Mathematica
a[n_] := PrimePi[Prime[n]^2] - n + 1; Array[a, 50] (* Jean-François Alcover, Dec 07 2015 *)
-
PARI
\\ A fast version: default(primelimit, 2^31 + 2^30); A054272(n) = 1 + primepi(prime(n)^2) - n; for(n=1, 5000, write("b054272.txt", n, " ", A054272(n))); \\ The following mirrors the given new formula. It is far from an optimal way to compute this sequence: allocatemem(234567890); A002110(n) = prod(i=1, n, prime(i)); A054272(n) = { my(p2); p2 = prime(n)^2; sumdiv(A002110(n), d, moebius(d)*floor(p2/d)); }; for(n=1, 22, print1(A054272(n),", ")); \\ Antti Karttunen, Dec 05 2014
Formula
a(n) = A000879(n) - n + 1.
From Antti Karttunen, Dec 05-08 2014: (Start)
a(n) = sum_{d | A002110(n)} moebius(d) * floor((p_n)^2 / d). [Where p_n is the n-th prime (A000040(n)) and A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could also use Liouville's lambda (A008836) instead of Moebius mu (A008683).]
The ratio (a(n) * A002110(n)) / (A001248(n) * A005867(n)) stays near 1, which follows from the above summation formula. See also A249747.
(End)
Comments