I want to calculate sum of even binomial coefficients in a efficient way. i.e $^nC_0 + ^nC_2 + ^nC_4 + ... + ^nC_k, 0< n, k < 10^{14}$ and $n>k$. I am using lucas algo for calculating nCr and loop for finding sum of all coefficients. It is taking hell lot of time for large numbers. Can anyone please help me with this ? Is there some kind of short formula or something that can help me ?
Asked
Active
Viewed 1,279 times
0
-
If you take very small values of $n$, say $n=5$, $n=6$,$n=7$, dont you find very simple values ? Try after that to look for a general "closed form" (very simple!) formula $\sum_{q=0}C_{2q}^n$ – Jean Marie Aug 20 '16 at 06:44
-
I don't think there is a nice formula unless all the terms are in there, i.e. $k=2[n/2]$. In that case this is a simple case of this technique. That is admittedly overkill, because the formulas for the sum of binomial coefficients and the alternating variant are both well known. – Jyrki Lahtonen Aug 20 '16 at 06:44
-
@Jyrki Lahtonen Reading anew the question, I agree with you : I thought at first that the sum was extended "till the end". Besides, something is certain : I dont know how it is possible to deal with gigantic numbers such as $\binom{10^{13}}{k}$, and their sum... – Jean Marie Aug 20 '16 at 08:02
-
3Possible duplicate of Evaluate $\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+...+\binom{n}{2k}$ – heropup Aug 28 '16 at 02:26