Created
March 26, 2016 22:46
-
-
Save monkeygroover/e6615a16727096e16992 to your computer and use it in GitHub Desktop.
euler20
This file contains hidden or 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
let units bi = (bi % 10I, bi/10I) | |
let rec sum bi = match units(bi) with | |
| (u, r) when r = 0I -> u | |
| (u, r) -> u + sum(r) | |
let rec fac(n:int): bigint = match n with | |
| 1 -> bigint(1) | |
| n -> bigint(n) * fac(n - 1) | |
let result = sum(fac(100)) | |
printfn "%A" result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment