Problem 116

前門と同じような考え方。むしろこっちのほうが簡単だと思う。

choose n r = div (product [n-r+1..n]) $ product [1..r]
replace m n = sum[choose (n+t-t*m) t | t<-[1..div n m]]
main = print.sum.zipWith replace [2,3,4] $ repeat 50
More Reading
Newer// Problem 115
Older// Problem 117