Example 1 Find the number of prime numbers not exceeding 100.
We take $N=100$, the prime numbers not exceeding $\sqrt{100}=10$ are $2,3,5,7$, so by formula (20) we get
$$\begin{aligned}
\pi(100)= & 4-1+100-\left\{\left[\frac{100}{2}\right]+\left[\frac{100}{3}\right]+\left[\frac{100}{5}\right]+\left[\frac{100}{7}\right]\right\} \\
& +\left\{\left[\frac{100}{2 \cdot 3}\right]+\left[\frac{100}{2 \cdot 5}\right]+\left[\frac{100}{2 \cdot 7}\right]+\left[\frac{100}{3 \cdot 5}\right]+\left[\frac{100}{3 \cdot 7}\right]+\left[\frac{100}{5 \cdot 7}\right]\right\} \\
& -\left\{\left[\frac{100}{2 \cdot 3 \cdot 5}\right]+\left[\frac{100}{2 \cdot 3 \cdot 7}\right]+\left[\frac{100}{2 \cdot 5 \cdot 7}\right]+\left[\frac{100}{3 \cdot 5 \cdot 7}\right]\right\} \\
& +\left[\frac{100}{2 \cdot 3 \cdot 5 \cdot 7}\right] \\
= & 4-1+100-117+45-6+0=25
\end{aligned}$$

This is consistent with the result in Section 2 of Chapter 1.