Skip to content

Instantly share code, notes, and snippets.

@ldunn
Created November 13, 2009 07:47
Show Gist options
  • Select an option

  • Save ldunn/233661 to your computer and use it in GitHub Desktop.

Select an option

Save ldunn/233661 to your computer and use it in GitHub Desktop.
(defun iscomposite (testnum)
(setq i 2)
(loop
(when (= i testnum)
(return-from iscomposite nil))
(if (= (mod testnum i) 0)
(return-from iscomposite t))
(setq i (+ i 1))))
(defun primefinder (maxnum)
(dotimes (i (- maxnum 3))
(if (not (iscomposite (+ i 3)))
(print (+ i 3)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment