solution to problem 007 in lisp
parent
7c5ec0040c
commit
f6a2d0acb3
|
@ -10,7 +10,7 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun prime (n)
|
(defun prime (n)
|
||||||
(eq (length (member T (mapcar (lambda (a) (eq (mod n a) 0)) (range 2 (sqrt n))))) 0)
|
(eq (length (member T (mapcar (lambda (a) (and (eq (mod n a) 0) (/= n a))) (range 2 (sqrt n))))) 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun cartesian-helper (thing list)
|
(defun cartesian-helper (thing list)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
(load "euler.lisp")
|
||||||
|
|
||||||
|
(defun solution ()
|
||||||
|
(first (reverse (loop for i from 2 when (prime i) collect i into prime-list when (eq 10001 (length prime-list)) return prime-list)))
|
||||||
|
)
|
Loading…
Reference in New Issue