diff --git a/5/euler5.rkt b/5/euler5.rkt new file mode 100644 index 0000000..da02856 --- /dev/null +++ b/5/euler5.rkt @@ -0,0 +1,12 @@ +#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