Racket Programming. Where am I going wrong?
The question i'm trying to answer: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? Where am I going wrong? my prime? test seems to be the issue, but it works fine on relatively small numbers. However the prime? test gives a wrong answer with larger numbers. Is there an easier way to go about this? (define b 3) (define z 0) (define divides? (lambda (a b) (= (remainder a b) 0))) (define (prime? n) (cond ((or (= n 1) (= n 0)) false) ((even? n) false) ((= n 2) true) ((= n b) true) ((divides? n b) false) (else (and (set! b (+ b 1))