multiples (of primes) coverage formula

557 Views Asked by At

I apologize in advance if my explanation is not clear. Please let me know if clarification is required and I will do my best to fix it!

I am attempting to find an explicit formula (in terms of independent/ dependent variables) of the Natural numbers (positive integers) that are covered by all the multiples of prime numbers. For example, 1/2 of the natural numbers are divisible by 2, 1/3 of the natural numbers are divisible by 3, 1/5 of the natural numbers are divisible by 5, (etc).

However, when considering the percentage of natural numbers covered by 2 and 3, one would be inclined to think that the percentage is 1/2 + 1/3. As most of us know, this is not the case. Of course 1/2 of the natural numbers is divisible by 2 and 1/3 are divisible by 3, but some natural numbers have been taken into consideration twice. Specifically, every 6th number (6, 12, 18, ...) is divisible by both 2 and 3. Therefore, the percentage of the natural numbers containing 2 and/or 3 is 1/2 + 1/3 - (1/6) = 2/3

When dealing with only a few prime numbers, this method is manageable. One can see how difficult and time-consuming this can become when considering more prime numbers. For example, consider the percentage of natural numbers covered by the first 4 primes - 2, 3, 5 and 7...

One method is to use Newton's identities. I won't bother explaining it as it would take up too much space.

If the prime numbers could be written as a function p(x), let p(1) = 2, p(2) = 3, p(3) = 5, p(4) = 7, p(5) = 11, . . .

Let c(x) be the function that represents the coverage of prime numbers (and its multiples). c(x) has a range between 0 and 1 and a domain greater than 0.

I have managed to derive the following 4 equations using Newton's identities:

enter image description here

In summary, I am wondering if it is possible to use Newton's identities (or any other methods) to make a general formula for the coverage of natural numbers.

1

There are 1 best solutions below

0
On

It so happens that I got interested to that same problem recently, I named it in the same way (which is why I found this earlier post) and I met the same difficulties.

If first wrote a computer program (in Python) to calculate the 'coverage' for the first i primes, on a set of N numbers, through "brute force". Essentially, it consists in running through all the integers from 0 to N and count those that are are divisible by one of those primes (let call that number n). Let c(i,N) be the coverage of the first i primes over the integers from 0 to N:

$$ c(i,N) = \frac{n}{N} $$

Then I changed around the numbers i and n, to get a feel of how this coverage would work.

The second step was to try to find an equation to calculate that coverage over $\mathbb{N}$. As Shane M. mentioned, the first formula that comes to mind:

$$ c(i) = \sum_1^N{\frac{1}{p(i)}}$$ doesn't work. The problem is that this series diverges when $N\rightarrow\infty$. That cannot be right, since (I reckon) the coverage of $\mathbb{N}$ by an infinite number of primes should be 1: $$\lim_{N\to \infty}{c(i,N)=c(i)}=1$$

I found that the suggestion by Sandeep Silwal to use the principle of inclusion/exclusion was not only familiar, it was spot on: $$\left |A \cap B \right| = |A| + |B| - |A \cap B| $$

Each time we introduce a new prime and its multiples, we need to take into account all its multiples that were already covered (that's the intersection part), otherwise we count them twice.

In particular, we already know that: $$c(1) = \frac{1}{2} = 0.5$$

The reason why the coverage of the first two primes is not $\frac{1}{2}+\frac{1}{3}$, is that, of course, there are many multiples of 3 which were already multiples of 2 (6, 12, 18, etc.). It so happens that this is 1 in 2: $$c(2) = \frac{1}{2}+\frac{1}{3} - \frac{1}{2}\frac{1}{3}=\frac{2}{3}=0.\bar6$$ This we can also write as: $$c(2) = c(1)+\frac{1}{3} - c(1)\frac{1}{3}$$

Going further with the third prime (5), there is an interesting (and simple) property: in the set of multiples of 5 ({0, 5, 10, 15, 20, 25, 30, 35, 40...}), $\frac{2}{3}$ are divisible by 2 or 3; the coverage is thus c(2).

The best explanation I found is the following: the set above can be written as: $\{1\times5, 2\times5, 3\times5, 4\times5, 5\times5,...\}$. Since 5 is a new prime, each element in this set is divisible by the 2 or 3 only if the first item in the multiplication is divisible. In other words, this set can be mapped onto $\{1, 2, 3, 4, 5,..\}$; and we know that c(2) is the coverage of that set (2 refers to the second prime, i.e. 3). $$c(3) = c(2) +\frac{1}{5} - c(2)\frac{1}{5}$$

This generalizes in the following formula for the coverage of $\mathbb{N}$ by the first i prime numbers. $$\bbox[yellow,5px]{ \begin{cases} c(i+1) = c(i)+\frac{1}{p(i+1)} - c(i)\frac{1}{p(i+1)}\\ c(0) = 0 \end{cases} }$$

The 'demonstration' about the intersection generalizes in this way: Let's call P(i) the set of numbers covered by the first i primes and M(i) the set of numbers covered by p(i), the nth prime.

$$M(i+1)=\{0\times{(i+1)}, 1\times{(i+1)}, 2\times({i+1)}, 3\times({i+1}), 4\times({i+1}), 5\times({i+1}),...\}$$

Since $p(i+1)\notin{P(i)}$ each of the elements of this set is divisible only if the first of its to factors is in P(i). Thus we can map this set onto $\{0, 1, 2, 3, 4...\}$ which is $\mathbb{N}$ and we know that its coverage with the first i prime numbers is c(i). QED.

I realize this is an imperfect write-up (too lengthy on one hand and there are some shortcuts on the other), but I believe the gist is here. I compared the results of this formula with the "brute force" calculation and it bears out (here are the first 10 primes):

+----+------+-----------------+--------------+------------+
| i  | p(i) |      c(i)       | c(i) decimal | c(i, 1000) |
+====+======+=================+==============+============+
| 1  | 2    | 1/2             | 0.500000     | 0.499990   |
+----+------+-----------------+--------------+------------+
| 2  | 3    | 2/3             | 0.666667     | 0.666660   |
+----+------+-----------------+--------------+------------+
| 3  | 5    | 11/15           | 0.733333     | 0.733330   |
+----+------+-----------------+--------------+------------+
| 4  | 7    | 27/35           | 0.771429     | 0.771420   |
+----+------+-----------------+--------------+------------+
| 5  | 11   | 61/77           | 0.792208     | 0.792200   |
+----+------+-----------------+--------------+------------+
| 6  | 13   | 809/1001        | 0.808192     | 0.808180   |
+----+------+-----------------+--------------+------------+
| 7  | 17   | 13945/17017     | 0.819475     | 0.819460   |
+----+------+-----------------+--------------+------------+
| 8  | 19   | 268027/323323   | 0.828976     | 0.828960   |
+----+------+-----------------+--------------+------------+
| 9  | 23   | 565447/676039   | 0.836412     | 0.836380   |
+----+------+-----------------+--------------+------------+
| 10 | 29   | 2358365/2800733 | 0.842053     | 0.841940   |
+----+------+-----------------+--------------+------------+