0

Like in the prime number theorem, but only with prime squares. It is an equation made out of the Sieve of Eratosthenes where x is the number of primes to the given prime’s square. Take a prime, in this case 7, and square it to 49. There are 3 primes before 7: 2, 3, 5. Multiply 49 by one-half (1/2), then by two-thirds (2/3) and by four-fifths (4/5). The result is 13 (rounded). Add three because there are three primes before 7 (2,3,5) and subtract 1 because 1 is not a prime. The result is 15. There are also 15 primes up to 49. This looks good at first but if you do the same with larger primes it starts to get more and more inaccurate. The reason is simple: after you subtract all the numbers divisible by two (multiply by two) from the set of numbers, one third of the remaining numbers are divisible by 3. If you subtract the numbers divisible by three (multiply the remaining by 2/3) and repeat this with all the following primes, you will get the problem starting from 7, because although it is still true for long sequences of numbers that exactly one seventh of the remaining numbers is divisible by seven, it is not true for short sequences, because there are not always 6 remaining numbers between two multiples of 7 (the gap can be more or less, it only true with sequent 2x3x5x7 that it evens out to every seventh on average). For example right at the beginning of the number series there is a big gap between a prime and the first multiple of it remaining (in case of 7 the first multiple of it that is not crossed out is 7 to the square = 49) and it has a big distortion to the result.

The equation in case the prime is 7: x = 7^2 * (1/2) * (2/3) * (4/5) + 3 - 1

Marci
  • 1
  • 2

1 Answers1

1

Yes, this is just the sieve of eratosthenes as you've already stated. However, it can be expressed more formally with better notation.

The sieve of eratosthenes counts the number of primes between $x$ and $x^2$ by sieving out all numbers with prime factors less than or equal to $x$.

Therefore, by writing $P = 2\cdot3\cdot5 \cdot ...\cdot p$ where $p$ is the largest prime not exceeding $x$, we are interested in the number of integers $n$, less than or equal to $x$ which share no common factors with $P$. This can be done quite simply using an inclusion-exclusion argument, from which one obtains.

$$\sum_{d|P}{\mu(d) \left[\frac{x^2}{d}\right] }$$

$$= x^2\sum_{d|P}{\frac{\mu(d)}{d}} - \sum_{d|P}{\mu(d)\left\{\frac{x^2}{d}\right\}}$$

$$= x^2\prod_{p\le x}{\left(1 - \frac{1}{p} \right)} - \sum_{d|P}{\mu(d)\left\{\frac{x^2}{d}\right\}}$$

Linking back to what you explained, the product above involving primes is the exact same product you had, which is then multiplied by the $x^2$ term. Also, note that the $x$ here doesn't have to necessarily be prime - any positive integer will work.

Next there's the right hand sum involving the fractional part function, and this is where your error term is coming from. Unfortunately, there isn't any nice way to calculate it, but you can always bound it by $O(2^{\pi(x)})$.

I apologise if any of this didn't make loads of sense, so here's a link that might explain things slightly better. https://mathworld.wolfram.com/SieveofEratosthenes.html

There's also a very similar maths stack exchange question here Prime Counting Function from the Sieve of Eratosthenes