Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created December 5, 2012 21:38
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/4219743 to your computer and use it in GitHub Desktop.
Save adilakhter/4219743 to your computer and use it in GitHub Desktop.
Euler Problem 2(1)
// Recursive solution
let eulerProblem2Answer'' =
let maxF = 4000000
let rec computeSum f1 f2 sum =
match f1 + f2 with
| n -> computeSum f2 n sum
| n when n%2 = 0 -> if (n<maxF) then (computeSum f2 n (sum+n)) else sum
computeSum 0 1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment