Project Euler Problem 53 Solution

Question

There are exactly ten ways of selecting three from five, 12345:

123,124,125,134,135,145,234,235,245, and 345123, 124, 125, 134, 135, 145, 234, 235, 245, \text{ and } 345

In combinatorics, we use the notation, 5C3=10^5C_3 = 10.

In general,

nCr=n!r!(nr)!, where rn,n!=n×(n1)×...×3×2×1, and 0!=1.^nC_r = \frac{n!}{r!(n-r)!}, \text{ where } r \leq n, n! = n\times(n-1)\times...\times3\times2\times1, \text{ and } 0! = 1.

It is not until n=23n = 23, that a value exceeds one-million: 23C10=1144066^{23}C_{10} = 1144066.

How many, not necessarily distinct, values of nCr^nC_r, for 1n1001 \leq n \leq 100, are greater than one-million?

Haskell

Python