Counting the prime numbers
The prime numbers seem to appear at random: 2, 3, 5, 7, 11, 13, then a gap until 17, 19, 23, another until 29. But seen from afar, they obey a rule. Call $\pi(x)$ the number of primes less than or equal to $x$. While still a teenager, Gauss noticed, looking at tables, that near a number $x$ the density of primes is about $\frac{1}{\ln x}$, and proposed the estimate
$$\pi(x) \approx \operatorname{li}(x) = \int_0^x \frac{dt}{\ln t},$$the logarithmic integral. Nobody knew how to prove that it was good, nor how to explain the deviations.