I have already tried the basic way to solve this series but it takes time for the larger values of n
& r
. Is there any way to reduce this expression in a single expression whose time complexity doesn't depend on the value of n
OR r
.Range r,n<=10^5
NOTE: here r < n
i.e. i have to find the sum of first r+1
terms of this series.
I have already read this question but it doesn't help me:
Algorithm to find Sum of the first r binomial coefficients for fixed n modulo m