3

The ratio of the count of all natural numbers divisible by $2$ to the count of all natural numbers is of course $\frac{1}{2}$ as there is no smaller prime than $2$.

The ratio of a count of all natural numbers divisible by $3$, but not by $2$ to the count of all natural numbers is $$\frac{1}{3}-\left(\frac{1}{2}\times\frac{1}{3}\right)=\frac{1}{6}$$

The ratio of a count of all natural numbers divisible by $5$, but not by $3$ or $2$ to the count of all natural numbers is $$\frac{1}{5}-\left(\frac{1}{2}\times\frac{1}{5}\right)-\left(\frac{1}{3}\times\frac{1}{5}\right)+\left(\frac{1}{2}\times\frac{1}{3}\times\frac{1}{5}\right)=\frac{1}{15}$$

The ratio of a count of all natural numbers divisible by $7$, but not by $5$, $3$ or $2$ to the count of all natural numbers is

$$\frac{1}{7}-\left(\frac{1}{2\ 7}+\frac{1}{3\ 7}+\frac{1}{5\ 7}-\frac{1}{2\ 3\ 7}-\frac{1}{2\ 5\ 7}-\frac{1}{3\ 5\ 7}+\frac{1}{2\ 3\ 5\ 7}\right)=\frac{4}{105}$$

This gets harder and harder to calculate with each larger prime. (I'm not completely sure this last one is correct)

Is there perhaps an easier way to think about this calculation to help find a general fraction formula for any prime, with the total sum of all fractions generated adding up to $1$?

  • 1
    "Inclusion-Exclusion" – JMoravitz Dec 22 '20 at 21:41
  • @JMoravitz but the concept of Inclusion-Exclusion is what the OP (perhaps unknowingly) has already manually derived. In my opinion, the OP's query therefore, still stands: is there a more elegant approach? – user2661923 Dec 22 '20 at 21:45
  • 2
    Your first sentence is false: both ‘counts’ are infinite, and their ratio is not defined. What is true is that the asymptotic density of the even integers is $\frac12$. – Brian M. Scott Dec 22 '20 at 21:45
  • You might take a look at $$\left(1-\frac1{p_1}\right)\left(1-\frac1{p_2}\right)\cdots\left(1-\frac1{p_n}\right)$$ Not your formula, but close – saulspatz Dec 22 '20 at 21:45
  • @BrianM.Scott Very interesting comment. I question whether the OP's assertion can be modified to be accurate. For example, if $n = 10^6$, then the chance of a number being chosen at random from ${1,2,\cdots,n}$, such that the number is even is in fact $(1/2).$ Further, this assertion will hold for any $n$ that is a multiple of $2$. Where the fun starts is what happens if $n \to \infty$ and $n$ is allowed to also be odd. Then, yes, I can see that asymptotic density kicks in. – user2661923 Dec 22 '20 at 21:52
  • @saulspatz had the right idea, but the correct formula for the asymptotic density is $\frac1{p_n}\left(1-\frac1{p_1}\right)\left(1-\frac1{p_2}\right)\cdots\left(1-\frac1{p_{n-1}}\right)$. This is closely related to Euler's totient function $\varphi$ that counts the number of positive integers up to $k$ relatively prime with it. If we take $k_n:=p_1\cdots p_n$ then $\frac{\varphi(k_{n-1})}{k_{n-1}}$ is the density of integers not divisible by smaller primes, and our percentage is $\frac1{p_n}\frac{\varphi(k_{n-1})}{k_{n-1}}$. – Conifold Dec 22 '20 at 22:51
  • @Conifold I wanted to leave it for the OP to work out himself. I did say, after all, that it wouldn't give the formula he wanted. – saulspatz Dec 22 '20 at 22:53
  • This is all very interesting and helpful. Thanks. – James Arathoon Dec 23 '20 at 00:36

1 Answers1

2

There's a much easier way to think about it. The natural density of natural numbers divisible by $p$ is $\frac{1}{p}$, so the density of numbers not divisible by $p$ is $1 - \frac{1}{p}$. Moreover the events of being divisible by different primes are "independent" in a suitable sense. So the density of natural numbers divisible by $p_n$ but not by $p_1, \dots p_{n-1}$ is

$$\left( \prod_{i=1}^{n-1} \left( 1 - \frac{1}{p_i} \right) \right) \frac{1}{p_n}.$$

Expanding this out produces the sum you get via inclusion-exclusion.

We need to be a little careful with this kind of "independence" reasoning because density is not actually a probability measure and so e.g. reasoning about infinitely many primes simultaneously this way is dodgy (although can, when done carefully, produce useful heuristics and conjectures), but you can prove rigorously that for finitely many primes everything works out. This is because the desired divisibility conditions are equivalent, via the Chinese remainder theorem, to a condition on the remainder $\bmod p_1 \dots p_n$, so the problem reduces to a counting problem in $\mathbb{Z}/(p_1 \dots p_n) \simeq \prod \mathbb{Z}/p_i$, which is finite.

Qiaochu Yuan
  • 419,620