書いてた人がいたので…
prime.scm
(use srfi-1)
(define (prime n)
(let loop ((lst (iota (- n 1) 2))(result '()))
(let ((solve (cons (car lst) result)))
(if (< (last lst) (* (car solve) (car solve)))
(append (reverse result) lst)
(loop (remove (^(x)(zero? (remainder x (car lst)))) lst) solve)))))
;(time (prime 10000))
; real 0.011
; user 0.010
; sys 0.000