Problem 15

When I first saw problem 15 in the project Euler site, I immediately remembered my math classes at the University. So, I used pen and paper to specify the solution by means of combinations. So, since the grid is 20 by 20, we would have the following binomial coefficient:

C(n,k) = C(40,20) = 40! / ( 20! (40-20)! ) = 40! / (20! 20!)

Then it was a matter of using Haskell ghci to calculate the factorial of 40 and 20 and finish the calculations.

Published: December 11 2009

blog comments powered by Disqus