Theorem (Sieve of Erastothenes – Legendre). Assuming that:

  • A[1,x]

  • 2zx

  • Assume the Sieve Hypothesis

Then S(A,P,z)=|A|p2pP(1g(p))+O(x12( log x)122 log x4 log z(dxd|P(z)|Rd|2)12+|A|e log x log zpzpP(1+g(p))e)