Standard Model equation

Euler problem 15.2

.

factorial n = facIter n 1
  where
    facIter m acc =
      if m == 0
      then acc
      else facIter (m - 1) (m * acc)

binomial n r = bIter n 1 `div` factorial r 
  where
    bIter m acc = 
      if m < n - r + 1
      then acc
      else bIter (m - 1) (m * acc)

f n = product [1..n]

b n r = product [(n-r+1)..n] `div` f r

— Me@2023-09-06 08:08:35 PM

.

.

2023.09.06 Wednesday (c) All rights reserved by ACHK