I might have written this in a needlessly cumbersome way, but I want to prove that for odd positive integers $n$, $$\sum_{k\ odd}^{n}\binom{2n+1}{2k}=\begin{cases} \binom{2^n+1}{2}, & \text{if}\ n\ \text{mod}\ 4 =1\\ \binom{2^n}{2}, & \text{if}\ n\ \text{mod}\ 4 =3 \end{cases}$$ I have tested these identities and they should hold in general. Thank you very much in advance!
Edit: I found the following formula in the wikipedia article for binomial coefficients, under multisections of sums (https://en.wikipedia.org/wiki/Binomial_coefficient#Multisections_of_sums) which works nicely.$$\binom{n}{2}+\binom{n}{6}+\binom{n}{10}+\cdots=\frac{1}{2}(2^{n-1}-2^{\frac{n}{2}}\cos\frac{n\pi}{4})$$ It would be great if someone can provide a reference or proof for this. Or if there is a much faster way of getting at the same result then please ignore this entirely.