Thursday, May 19, 2005

Fundamental theorem of arithmetic

Finding prime numbers is like factoring infinity.

2 Comments:

Blogger Emma Cunningham said...

you should use this:

(define (search-for-primes x n)
(if (= n 0)
(print "done!")
(cond ((prime? (+ x 1))
(begin
(print (+ x 1))
(print " ")
(search-for-primes (+ x 1) (- n 1))))
(else
(search-for-primes (+ x 1) n)))))

11:03 AM  
Blogger letdinosaursdie said...

I would if I could put in infinity for n.

12:01 AM  

Post a Comment

<< Home