diff --git a/5/euler5.rkt b/5/euler5.rkt index da02856..1b0dc32 100644 --- a/5/euler5.rkt +++ b/5/euler5.rkt @@ -1,12 +1,4 @@ #lang racket - -(define (divisible-by? num lst) - (andmap (λ (x) (zero? (remainder num x))) lst)) - -(define (find-divisible-num it lst) - (if (divisible-by? it lst) - it - (find-divisible-num (+ 2 it) lst))) - -(find-divisible-num 2 (range 1 21)) \ No newline at end of file +(do ((n 20 (+ n 20))) + ((andmap zero? (map ((curry remainder) n) (range 1 21))) n)) \ No newline at end of file