Welcome to the CHICKEN Scheme pasting service

a fairly simply sieve-like impl added by elflng on Wed May 11 06:43:04 2016

(define (prime-iter n sn l)
    (let loop ((p   (reverse l)))
        ; we dont need to check for null because of how it was set up
        (if (> sn (car p))
            (cons n l)
            (if (= 0 (modulo n (car p)))
                l
                (loop (cdr p))))))

(define (gen-primes n)
    (let loop ((i   15)
               (l   '(13 11 7 5 3 2)))
;        (display (conc i " " l "\n"))
        (if (>= i n)
	    l
	    (loop (+ 2 i) (prime-iter i (sqrt i) l)))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Name of the bot in #chicken:
Visually impaired? Let me spell it for you (wav file) download WAV