# Estimating the Number of Primes Between Two Consecutive Squares from the Product of these Primes

Using the prime number theorem the number of primes between two squares can be approximated by $$Li((N+1)^2)-Li((N)^2) \approx \frac{N}{\log N}$$ where $Li(x)=\int_2^x \frac{dt}{log t}$

However if the number of primes, n, between two consecutive squares is approximated by $$n \approx \frac{\log(p_1 \times p_2 \times ... \times p_n)}{log(\sqrt{N^2(N+1)^2})}$$ the error in the estimate appears to be much smaller. The accuracy of this estimate must depend on how the primes are distributed between the two squares. (We assume that the the product of the primes between two consecutive squares can be exactly determined without knowing the exact number of these primes).

e.g.

(1) for primes between $6^2$ and $7^2$, $n \approx \frac{\log(37 \times 41 \times 43 \times 47)}{log(6 \times 7)}=3.9960$

where as $\frac{6}{ln(6)}=3.349$

(2) for primes between $7^2$ and $8^2$, $n \approx \frac{\log(53 \times 59 \times 61)}{log(7 \times 8)}=3.0205$

where as $\frac{7}{ln(7)}=3.597$

The only way I can think of creating elementary bounds on these estimates is rounding n then calculating the estimate using the n highest odd numbers and the n lowest odd numbers between the two consecutive squares. Therefore for example (1)

$$\frac{\log(37 \times 39 \times 41 \times 43)}{log(6 \times 7)} < n < \frac{\log(41 \times 43 \times 45 \times 47)}{log(6 \times 7)}$$

Will such an estimate based on a knowledge of the product of all the primes between two consecutive squares always be less than the estimate $\frac{N}{\log(N)}$ based on the prime number theorem?

• If you know all the primes between two consecutive squares, then you already know how many of them there are. At that point, what is the need for the estimate? – Michael Lugo Sep 11 '17 at 16:29
• I don't know the primes between two consecutive squares just the product of these primes or some close estimate of it. (I just put the primes into the examples to show I had my sums right). – James Arathoon Sep 11 '17 at 19:04
• continued... If this prime product is estimated and the error in the estimate is low enough (at least within the bounds set out at the base of the post) then it appears from this non rigorous argument we can calculate the exact number of primes involved in the product if the maximum error bounds for $(n-1)$, $n$ and $(n+1)$ primes (calculated as above) are a long way from overlapping, and we stay within these bounds when making the estimate of the product. – James Arathoon Sep 11 '17 at 19:05