Poisson distribution and prime numbers
Let I(n) be the number of distinct prime factors of x. A theorem of Landau says that for N large, then for randomly selected positive integers less than N, I-1 has a Poisson(log log N) distribution. This statement holds in the limit as N goes to infinity.
Apparently N has to be extremely large before the result approximately holds. I ran an experiment for N = 10,000,000 and the fit is not great.
Here's the data:
|----+----------+-----------|| | Observed | Predicted ||----+----------+-----------|| 1 | 665134 | 620420.6 || 2 | 2536837 | 1724733.8 || 3 | 3642766 | 2397330.6 || 4 | 2389433 | 2221480.4 || 5 | 691209 | 1543897.1 || 6 | 72902 | 858389.0 || 7 | 1716 | 397712.0 || 8 | 1 | 157945.2 || 9 | 0 | 54884.8 || 10 | 0 | 16952.9 ||----+----------+-----------|
And here's a plot:
I found the above theorem in these notes. It's possible I've misunderstood something or there's an error in the notes. I haven't found a more formal reference on the theorem yet.
Update: According to the results in the comments below, it seems that the notes I cited may be wrong. The notes say "distinct prime factors", i.e. I(n), while numerical results suggest they meant to say I(C)(n), the number of prime factors counted with multiplicity. I verified the numbers given below. Here's a plot.
Here's the Python code I used to generate the table. (To match the code for the revised graph, replace omega which calculated I(n) with the SymPy function primeomega which calculates I(C)(n).)
from sympy import factorintfrom numpy import empty, log, log2from scipy.stats import poissonN = 10000000def omega(n): return len(factorint(n))table = empty(N, int)table[0] = table[1] = 0for n in range(2, N): table[n] = omega(n)# upper bound on the largest value of omega(n) for n < N.u = int(log2(N))for n in range(1, u+1): print(n, len(table[table==n]), poisson(log(log(N))).pmf(n-1)*N)Related posts