This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/5/euler5.rkt

12 lines
251 B
Racket
Raw Normal View History

2017-05-09 19:55:27 +02:00
#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))