doubt in sieve in linear time

Revision en2, by Aden_blizzard, 2021-02-07 09:06:31

https://cp-algorithms.com/algebra/prime-sieve-linear.html in this code for sieve in linear time complexity what is the use of pr[j]<=lp[i]? is there any reason to write this as i tried many test case but it works fine without this ....is there any case where it fails?

Tags sieve

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Aden_blizzard 2021-02-07 09:06:31 281
en1 English Aden_blizzard 2021-02-07 09:05:46 510 Initial revision (published)