I am trying to compute the number of possible ways, in which $r$ objects can be chosen from a bin containing $n$ distinct objects, such that $r$ is a multiple of $4$. ($r$ can be $0$).
$$\sum_{i=0}^{\lfloor{n/4}\rfloor}\binom{n}{4i}$$
When I am trying to compute this, it's taking a lot of time.
I have tried to find an equivalent expression by iteratively using the following identity, but I am not able to reduce it to a simpler form.
$$ \binom{n}{r}=\binom{n-1}{r-1}+\binom{n-1}{r}\binom{n}{r}$$
Can someone help me find a simpler expression for the above expression? I am looking for an equivalent expression that's easy to compute.
Yes there is. In fact, you can generalise by using steps of size $s$ so that the sum is
$$\sum_{k=0}^{\lfloor n/s\rfloor}\binom{n}{sk}$$
Simply consider the $s$-roots of unity $\{e^{2(0)i\pi/s},e^{2i\pi/s},e^{4i\pi/s},\ldots,e^{2(s-1)i\pi/s}\}$ then input them into the binomial formula
$$(1+z)^n=\sum_{k=0}^{n}\binom{n}{k}z^k$$
giving
$$(1+e^{2i(0)\pi/s})^n=\sum_{k=0}^{n}\binom{n}{k}e^{2k(0)i\pi/s}$$ $$(1+e^{2i\pi/s})^n=\sum_{k=0}^{n}\binom{n}{k}e^{2ki\pi/s}$$ $$(1+e^{4i\pi/s})^n=\sum_{k=0}^{n}\binom{n}{k}e^{4ki\pi/s}$$ $$\vdots$$ $$(1+e^{2(s-1)i\pi/s})^n=\sum_{k=0}^{n}\binom{n}{k}e^{2k(s-1)i\pi/s}\, .$$
Add these up
$$\sum_{r=0}^{s-1}(1+e^{2ri\pi/s})^n=\sum_{k=0}^{n}\binom{n}{k}\sum_{r=0}^{s-1}e^{2kri\pi/s}\tag{1}$$
Notice the order of summation swap on the right.
Now, the inner sum
$$\sum_{r=0}^{s-1}e^{2kri\pi/s}$$
is a finite geometric series with ratio $e^{2ki\pi/s}$ and first term $1$.
$$\frac{1-e^{2ki\pi}}{1-e^{2ki\pi/s}}=\frac{0}{1-e^{2ki\pi/s}}=0\, .$$
We have, for $(1)$:
$$\sum_{r=0}^{s-1}(1+e^{2ri\pi/s})^n=s\sum_{k=0}^{\lfloor n/s\rfloor}\binom{n}{sk}\, ,$$
or
$$\sum_{k=0}^{\lfloor n/s\rfloor}\binom{n}{sk}=\frac{1}{s}\sum_{r=0}^{s-1}(1+e^{2ri\pi/s})^n$$
In this case $s=4$:
this may be simplified but I'll leave that as an exercise.
This method is called the "roots of unity filter" or the "discrete fourier transform method".