Long primes: Difference between revisions
m
→{{header|Common Lisp}}
m (→{{header|Common Lisp}}: Fix name of long-prime-p) |
|||
Line 515:
=={{header|Common Lisp}}==
{{trans|Raku}}
<lang lisp>
; Primality teste using the Sieve of Eratosthenes with a couple minor optimizations
(defun primep (n)
(cond ((and (<= n 3) (> n 1)) t)
((some #'zerop (mapcar (lambda (d) (mod n d)) '(2 3))) nil)
Line 523 ⟶ 525:
finally (return t)))))
; Translation of the long-prime algorithm from the Raku solution
(defun long-prime-p (n)
(cond
|