title: Algorithm to find Sum of the first r binomial coefficients for fixed n modulo m
body: <p>I am trying to find the sum of the first r binomial coefficients for a fixed n.</p>
  
  <h2>(nC1 + nC2 + nC3 + ... + nCr) % M</h2>
  
  <p>where r &lt; = n.</p>
  
  <p>Is there an efficient algorithm to solve this problem ?</p>