Estimate a "prime parabola"?

243 Views Asked by At

I have recently had a thought to construct a parabola by zooming in all the way on a pixel grid, then drawing it in rectangles and zooming out afterwards.

For example, we start by drawing $1\times1$ box in the center of the coordinate system. Then lets make the second stack of blocks bigger by $+1$ on both sides and join them next to the previous block, and repeat. Then join the outer points of the stacks to get a parabola. Image:

enter image description here

We can work out the formula for this parabola.
The $x$s of the points are $0+\frac{1}{2}, 1+\frac{1}{2}, 2+\frac{1}{2}, 3+\frac{1}{2}, 4+\frac{1}{2} \dots$
The $y$s of the points are $-1+\frac{1}{2}, 0+\frac{1}{2}, 2+\frac{1}{2}, 5+\frac{1}{2},9+\frac{1}{2}\dots$

Meaning the $x$ coordinates have a sequence formula $n-\frac{1}{2}$
And the $y$ coordinates have a sequence formula $\frac{n(n-1)}{2}-\frac{1}{2}$

From that we can work out that $f(x) = \frac{1}{2}x^2-\frac{5}{8}$


But what if our stacks are the prime numbers?
First stack centered at $(0,0)$ then is $1\times2$ followed by $1\times3, 1\times5,1\times7,1\times11 \dots$

Since we can't have a sequence that will produce primes, can we at least estimate the $f(x)$ for such a "parabola" for all primes?

Or how can we find such a function that'll be correct for at least first $n$ primes?


"parabola" $\to$ I'm thinking that the construction won't yield a parabola, but a curve that looks similarly to a parabola.

2

There are 2 best solutions below

2
On BEST ANSWER

As you noted, there is no simple precise formula. But there are estimates.

For example:

  1. the number of primes below $n$ is $\pi(n)\approx\frac{n}{\ln(n)}$
  2. the $n$'th prime is $p_n\approx n \ln(n)$
  3. the sum of the first $n$ primes is $\sum_{k=1}^np_n\approx \frac{n^2}{2}\ln(n)$

(For sources and more precise versions of these formulas, see https://en.wikipedia.org/wiki/Prime_number_theorem)

So you may take something like $f(x)=\frac{x^2}{2}\ln(x)$, which is indeed similar to a parabola.

0
On

The stacks really just sum up to the Prime Sums.

Meaning we get the following function that estimates (is similar) to the curve that is being constructed by stacking prime numbers:

$f(x)=\frac{\ln{|x|}}{2}x^2$

enter image description here

Thus, this estimates all the primes to some degree.


For exactly $n$ primes, we can use Lagrange interpolation polynomial of degree $n-1$.

This was done in Mathematica here.