Is there a formula that can tell us how many distinct prime factors a number has? We have closed form solutions for the number of factors a number has and the sum of those factors but not the number of distinct prime factors.
So for example: \begin{array}{rr} \text{number} & \text{distinct}\atop \text{prime factors} \\ 1&0 \\ 2&1 \\ 3&1 \\ 4&1 \\ 5&1 \\ 6&2 \\ 7&1 \\ 8&1 \\ 9&1 \\ 10&2 \end{array}
This is a historically interesting question as it led Hardy and Ramanujan to lay the foundation to probabilistic number theory in course of their solution to this problem. Given $n$ there is no non-trivial deterministic closed form formula for the number of distinct prime factors of $n$. However we have very good probabilistic formula for the same.
We can do much better than the Hardy-Ramanujan estimate and find and estimate of $\omega(n)$ which can be bounded by normal distribution. Erdos and Kac imporved the estimate of $\omega(n)$ and proved that
This formula says that if $n$ is a large number, we can estimate the distribution of the number of prime factors for numbers of this range. For example we can show that around 12.6% of 10,000 digit numbers are constructed from 10 distinct prime numbers and around 68% (±$\sigma$) are constructed from between 7 and 13 distinct primes.