Created
March 14, 2018 03:37
-
-
Save TakashiHarada/312c65333110de6c3cb44c1c30927a5d to your computer and use it in GitHub Desktop.
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
fact :: Integer -> Integer | |
fact n = product [1..n] | |
comb :: Integer -> Integer -> Integer | |
comb n k = product [(n-k+1)..n] `div` (fact k) | |
f :: Integer -> Integer | |
f w = sum [(comb (3^w) k) * (fact k) * 2^k | k <- [1..3^w]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment