Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created February 5, 2013 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/4718681 to your computer and use it in GitHub Desktop.
Save adilakhter/4718681 to your computer and use it in GitHub Desktop.
euler problem 06 with fsharp
open System
let squareOfSum n =
let i = n*(n+1)/2
i*i
let sumOfSquare n =
[1..n]
|> List.fold (fun acc x -> acc + x*x) 0
let solveEuler6 N =
(squareOfSum N)- (sumOfSquare N)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment