Created
December 11, 2008 21:16
-
-
Save cbilson/34877 to your computer and use it in GitHub Desktop.
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
#light | |
(* | |
Project Euler Problem 6 | |
*) | |
let sumOfSquares n = | |
seq { 1 .. n } |> Seq.fold (fun a x -> a + float(x) * float(x)) 0.0 | |
let squareOfSums n = | |
let sum = seq { 1 .. n } |> Seq.sum | |
float(sum * sum) | |
let problem6 = | |
(squareOfSums 100) - (sumOfSquares 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment