Show a sequence of distinct Primes number is O(log n) Suppose I have a sequence:

$$n = \prod_{i=1}^{r(n)} p_i^{d_i}$$

for some primes $p_1 &lt; p_2 &lt; \dots &lt; p_{r(n)}$, and each $d_i \geq 1$ an integer. The function $r(n)$ denotes the number of distinct primes divisor of $n$.

I'm trying to show $r(n) = O(\log n)$.

What I have tried:
I think I can establish an upper bound on $\prod_{i=1}^{r(n)} p_i^{d_i}$ to show its asymptotic bound.

To simplify and without loss of generality, let $d_i = 1$. Then,

$$n = \prod_{i=1}^{r(n)} p_i$$
$$\log n = \log (\prod_{i=1}^{r(n)} p_i)$$
$$\log n \geq \Sigma_{i=1}^{r(n)} \log p_i$$

Then not sure where to go from here.

I think I want to show something like:

$$\log n \geq \frac{r(n) + 1}{2}$$
Since each of the prime numbers is at least 2, we have
$$n \geq \prod_{i=1}^{r(n)} p_i \geq \prod_{i=1}^{r(n)} 2 = 2^{r(n)}, $$
from which it follows that $r(n) \leq \log_2 n$.

In fact, since the prime numbers are generally larger than 2, we can obtain a better bound, namely $$ r(n) \lesssim \frac{\log n}{\log \log n}. $$
See for example MathWorld, which states the number of distinct prime factors in a primorial.