# Thread: Prime number computation

1. ## Prime number computation

Approximately how many primes less than one trillion $(10^12)$ are there? I.e, compute pi(1000000000000) (Show computation)

2. Originally Posted by purplerain
Approximately how many primes less than one trillion $(10^{12})$ are there? I.e, compute pi(1000000000000) (Show computation)
See this thread (among others).

The simplest approximation is:

$\pi(x)\approx \frac{x}{\ln(x)}$

so:

$\pi(10^{12})\approx \frac{10^{12}}{\ln(10^{12})}\approx 3.619 \times 10^{10}$

CB