Can you determine small primes from larger primes?

61 Views Asked by At

Suppose you are given the primes in the range $[n,n^2]$. Is there a known way to effectively reconstruct the primes less than $n$? Ideally, something that takes less calculation than figuring them out directly from sieving, as that would sort of defeat the purpose.

Heuristically, you can do pretty well by taking $n \pmod{p}$ where $n$ is composite and $p$ steps through your prime list, and then seeing what comes up most often, but I'm hoping for something better than that.

1

There are 1 best solutions below

1
On

This is very slow compared to e.g. the sieve method. For example with $n=1000$ there are $\pi(10^6)-\pi(10^3) = 78330$ primes in $[n,n^2]$ but only $168$ primes less than $1000$. So you would do $78330$ modulo operation with your method. For larger $n$ your method would even be worse.