Created
November 4, 2014 05:23
-
-
Save tgallant/eb277c5410fcbc6e1d90 to your computer and use it in GitHub Desktop.
euler4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; e4 | |
(define (e4) | |
(define (e4-inner x y) | |
(let ((i (* x y))) | |
(if (> x 999) | |
'() | |
(if (< y 999) | |
(if (= i (rev i)) | |
(cons i (e4-inner x (+ y 1))) | |
(e4-inner x (+ y 1))) | |
(if (= i (rev i)) | |
(cons i (e4-inner (+ x 1) 900)) | |
(e4-inner (+ x 1) 900)))))) | |
(apply max (e4-inner 900 900))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment