From 7ae79991f52d35944a51d89b755ab348d99ac1a2 Mon Sep 17 00:00:00 2001 From: Lowl3v3l Date: Tue, 9 May 2017 19:55:27 +0200 Subject: [PATCH] racket solution for problem 5 --- 5/euler5.rkt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 5/euler5.rkt 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