How do I get prime numbers 1-100 ?
Discussion posts and replies are publicly visible
----------------
gives all the prime numbers
a!localVariables( local!testWith:enumerate(tointeger(sqrt(ri!number)))+2, local!test:remove(local!testWith,local!testWith[length(local!testWith)-1]), where(a!forEach( items: local!test, expression:if(mod(ri!number,fv!item)=0,true,false()) ) ) )
------------------------------------------------------
P_getPrimenumbers
a!forEach( items: enumerate(100)+3, expression: if(length(rule!P_checkPrime(fv!item))>0 , {}, fv!item ) )