## Number of primes for n less than 1000, approximation formula

This is about an approximation formula I came up with for the number of primes less than or equal to n, for $\displaystyle \ \ 10 \le n \le 1,000$.

The number of primes less than or equal to n is pi(n) or $\displaystyle \ \pi(n)$. For instance, for n = 10, $\displaystyle \ \pi(10) = 4, \$ because there are four primes
less than or equal to 10.

It is based on fitting $\displaystyle \ (n, \pi(n)) \$ coordinates to the half-parabola $\displaystyle \ y = a\sqrt{x + h \ } + k \$, with the known coordinates of (10, 4), (100, 25), and (1000, 168).

Round[n] is used to round up to the nearest integer or down to the nearest integer, as is appropriate.

$\displaystyle \pi(n) \ \approx \ Round[9\sqrt{n + 320} - 160]$

Compare the formula's output to the actual one for several n-values:

n . . . . approx. . . actual pi(n)
________________________

$\displaystyle 10 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4$
$\displaystyle 25 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 7 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 9$
$\displaystyle 50 \ \ \ \ \ \ \ \ \ \ \ \ \ 13 \ \ \ \ \ \ \ \ \ \ \ \ \ 15$
$\displaystyle 75 \ \ \ \ \ \ \ \ \ \ \ \ \ 19 \ \ \ \ \ \ \ \ \ \ \ \ \ 21$
$\displaystyle 100 \ \ \ \ \ \ \ \ \ \ \ 24 \ \ \ \ \ \ \ \ \ \ \ \ \ 25$
$\displaystyle 200 \ \ \ \ \ \ \ \ \ \ \ 45 \ \ \ \ \ \ \ \ \ \ \ \ \ 46$
$\displaystyle 300 \ \ \ \ \ \ \ \ \ \ \ 64 \ \ \ \ \ \ \ \ \ \ \ \ \ 62$
$\displaystyle 400 \ \ \ \ \ \ \ \ \ \ \ 81 \ \ \ \ \ \ \ \ \ \ \ \ \ 78$
$\displaystyle 500 \ \ \ \ \ \ \ \ \ \ \ 98 \ \ \ \ \ \ \ \ \ \ \ \ \ 95$
$\displaystyle 600 \ \ \ \ \ \ \ \ \ 113 \ \ \ \ \ \ \ \ \ \ \ 109$
$\displaystyle 700 \ \ \ \ \ \ \ \ \ 127 \ \ \ \ \ \ \ \ \ \ \ 125$
$\displaystyle 800 \ \ \ \ \ \ \ \ \ 141\ \ \ \ \ \ \ \ \ \ \ 139$
$\displaystyle 900 \ \ \ \ \ \ \ \ \ 154 \ \ \ \ \ \ \ \ \ \ \ 154$
$\displaystyle 1000 \ \ \ \ \ \ \ 167 \ \ \ \ \ \ \ \ \ \ \ 168$