Created
November 4, 2014 05:29
-
-
Save tgallant/a9589cf46a746bbb8fa3 to your computer and use it in GitHub Desktop.
euler5
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
;; helpers | |
(define (sum l) | |
(if (null? l) | |
0 | |
(+ (car l) (sum (cdr l))))) | |
(define (sqr x) | |
(* x x)) | |
;; e5 | |
(define (sum-of-sq x) | |
(sum (map sqr (cdr (iota x))))) | |
(define (sq-of-sum x) | |
(sqr (sum (cdr (iota x))))) | |
(define (e6 x) | |
(- (sq-of-sum x) (sum-of-sq x))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment