Skip to content

Instantly share code, notes, and snippets.

@tgallant
Created November 4, 2014 05:23
Show Gist options
  • Save tgallant/eb277c5410fcbc6e1d90 to your computer and use it in GitHub Desktop.
Save tgallant/eb277c5410fcbc6e1d90 to your computer and use it in GitHub Desktop.
euler4
;; 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