Solution (source code)

= Solution

One general form of the <Erdős-Kac theorem> is the following. Let $f$ be a real <strongly additive arithmetic function>, with $|f(p)|\le C$ for all <primes>, and define
$$
A(x)=\sum_{p\le x}\frac{f(p)}p,\qquad B(x)^2=\sum_{p\le x}\frac{f(p)^2}p.
$$
If $B(x)\to\infty$, then under the <discrete uniform distribution> on $[N]$,
$$
\boxed{\frac{f(n)-A(N)}{B(N)}\ \xrightarrow{\mathrm d}\ \mathcal N(0,1).}
$$
Here the arrow denotes <convergence in distribution> and $\mathcal N(0,1)$ is the <standard normal distribution>. Equivalently, the probability of being at most $z$ tends to the <standard normal distribution function> $\Phi(z)$ for every real $z$. Replacing $B(x)^2$ by $\sum_{p\le x}f(p)^2(1-1/p)/p$ is equivalent, because the difference is bounded by $C^2\sum_p p^{-2}$.

This is a general bounded-prime-weight form, not just the special case $f=\omega$. In that case the <Mertens theorem for reciprocal primes> gives $A(N)=\log\log N+O(1)$ and $B(N)^2=\log\log N+O(1)$, so \b[the classical prime-factor central limit theorem] is
$$
\boxed{\frac{\omega(n)-\log\log N}{\sqrt{\log\log N}}\ \xrightarrow{\mathrm d}\ \mathcal N(0,1).}
$$