Hi ,
Thank you for great explanation that you provided to find prime numbers.
It seems there is a problem with functions you have created . It’s not giving correct prime numbers, I marked it in bold.
q)es[sieve1]10023 **4** 5711131719 **22** 23 **26** 29313437 **38** 4143 **46** 4753585961 **62** 6771737479 **82** 83 **86** 89 **94** 97
q)es[sieve2;100]
2 3 **4** 5 7 11 13 17 19 **22** 23 **26** 29 31 34 37 **38** 41 43 **46** 47 53 58 59 61 62 67 7..
Just check with you, I was trying to run below function with scan instead of over because I want to verify mid results, however it is throwing type error.
es:{[s;N]{x,1+wherey}.({anyz#y}[;;floorsqrtN].)s **\** (2;0b,01bwhere1,N-2)}
Could you please revisit the solution you have provided.