Sieve is not fast enough to have primes of 10^9 under 1 sec. Earlier I came across a blog, which discussed about Meissel-Lehmer algo for the same. It is getting hard implementing that stuff.
Can anyone provide code for the same in Python.
Or any other algo that performs the same. Code in Python would be great.