Closed ldemailly closed 1 month ago
trying to share
func primesGen(mx){sieve=[true]*mx num=2 cp=2 nextPrime=()=>{for cp<mx{if sieve[cp]{prime=cp cp++mult=prime*prime for max(mx-mult,0){if mult%prime==0{sieve[mult]=false}mult++}return prime}else{cp++}}}}maxS=10_000 primeIter=primesGen(maxS) p=0 for p<=maxS{p=primeIter() print(" ",p)}
probably the %
%
trying to share
probably the
%