Primality by trial division: Difference between revisions

(→‎{{header|Sidef}}: added an alternative version, which excludes multiples of 2 and 3)
Line 657:
(odd? x)
(not-any? (partial divides? x)
(range 3 (mathinc (Math/sqrt x)) 2)))))</lang>
 
Testing only prime divisors:
Line 670:
(< 1 x)
(not-any? (partial divides? x)
(take-while (partial >= (mathMath/sqrt x)) primes)))))
</lang>