racket solution for problem 5

This commit is contained in:
Lowl3v3l 2017-05-09 19:55:27 +02:00
parent 88e45dc7a3
commit 7ae79991f5

12
5/euler5.rkt Normal file
View file

@ -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))