Finding the real and imary part of complex number using sigma notation I am trying to figure out the follwoing
\begin{align*}
2^{\frac{n}{2}}\Big[\cos(\frac{n\pi}{4})+i\sin(\frac{n\pi}{4})\Big]&=2^{\frac{n}{2}}\Big[\cos(\frac{\pi}{4})+i\sin(\frac{\pi}{4})\Big]^n\\
&=(1+i)^n\\
&=1+\begin{pmatrix}n\\1\end{pmatrix}i-\begin{pmatrix}n\\2\end{pmatrix}-\begin{pmatrix}n\\3\end{pmatrix}i+\begin{pmatrix}n\\4\end{pmatrix}+........
\end{align*}
I am trying to find the real and imaginary part in sigma notation. Any help would be appreciated.
 A: In $2^{\frac{n}{2}}\Big[\cos(\frac{n\pi}{4})+i\sin(\frac{n\pi}{4})\Big]$ the real and imaginary part are respectively : $R=2^{\frac{n}{2}}\cos(\frac{n\pi}{4})$ and $I=2^{\frac{n}{2}}\sin(\frac{n\pi}{4})$.
Then you can study the values of $R$ ad $I$ for different values of $n \mod 8$.
$$n=0\pmod8 \Rightarrow R=2^{\frac{n}{2}}, I=0 \\ 
n=1 \pmod 8 \Rightarrow R=2^{\frac{n}{2}}\frac{\sqrt2}{2}, I=2^{\frac{n}{2}}\frac{\sqrt2}{2} \\ 
n=2 \pmod 8 \Rightarrow R=0, I=2^{\frac{n}{2}} \\
n=3 \pmod 8 \Rightarrow R=-2^{\frac{n}{2}}\frac{\sqrt2}{2}, I=2^{\frac{n}{2}}\frac{\sqrt2}{2} \\
n=4 \pmod 8 \Rightarrow R=-2^{\frac{n}{2}}, I=0 \\
n=5 \pmod 8 \Rightarrow R=-2^{\frac{n}{2}}\frac{\sqrt2}{2}, I=-2^{\frac{n}{2}}\frac{\sqrt2}{2} \\
n=6 \pmod 8 \Rightarrow R=0, I=-2^{\frac{n}{2}}\\
n=7 \pmod 8 \Rightarrow R=2^{\frac{n}{2}}\frac{\sqrt2}{2}, I=-2^{\frac{n}{2}}\frac{\sqrt2}{2} $$

In the sigma notation :
\begin{align*}
2^{\frac{n}{2}}\Big[\cos(\frac{n\pi}{4})+i\sin(\frac{n\pi}{4})\Big]&=2^{\frac{n}{2}}\Big[\cos(\frac{\pi}{4})+i\sin(\frac{\pi}{4})\Big]^n\\
&=(1+i)^n\\
&=1+\begin{pmatrix}n\\1\end{pmatrix}-\begin{pmatrix}n\\2\end{pmatrix}+\begin{pmatrix}n\\3\end{pmatrix}-\begin{pmatrix}n\\4\end{pmatrix}+........
\end{align*}
The last line i wrong, it should be :
$$1+i\begin{pmatrix}n\\1\end{pmatrix}-\begin{pmatrix}n\\2\end{pmatrix}-i\begin{pmatrix}n\\3\end{pmatrix}+\begin{pmatrix}n\\4\end{pmatrix}+........ \\ =\sum_{j=0}^ni^j\binom{n}{j}$$
So $$R=\sum_{j=0}^{\lfloor{n/2}\rfloor}(-1)^{j}\binom{n}{2j}$$ and $$I=\sum_{j=0}^{\lfloor{(n-1)/2}\rfloor}(-1)^{j}\binom{n}{2j+1}$$
A: We know
$$e^{ix}=\exp(ix)=\cos(x)+i\sin(x)$$
so
\begin{align*}
2^{\frac{n}{2}}\Big[\cos(\frac{n\pi}{4})+i\sin(\frac{n\pi}{4})\Big]
&=2^{\frac{n}{2}}\Big[\exp\Big(i\frac{n\pi}{4}\Big)\Big]\\
&=2^{\frac{n}{2}}\Big[\exp\Big(i\frac{\pi}{4}\Big)\Big]^{n}\\
&=2^{\frac{n}{2}}\Big[\cos(\frac{\pi}{4})+i\sin(\frac{\pi}{4})\Big]^n\\
&=\Big(2^{\frac{1}{2}}\Big)^{n}\Big[\cos(\frac{\pi}{4})+i\sin(\frac{\pi}{4})\Big]^n\\
&=\Big(\sqrt2\ \Big)^{n}\Big[\frac{1}{\sqrt2}+i\frac{1}{\sqrt2}\Big]^n\\
&=\Big(\sqrt2\cdot\Big[\frac{1}{\sqrt2}+i\frac{1}{\sqrt2}\Big]\Big)^{n}\\
&=(1+i)^n
\end{align*}
Now I use Binomial Theorem
$$(a+b)^n=\sum_{k=0}^{n}{\binom{n}{k}a^k b^{n-k}}$$
if $a=i$ and $b=1$ then
$$
\begin{align}
(a+b)^n&=(i+1)^n\\
&=\sum_{k=0}^{n}{\binom{n}{k}i^k 1^{n-k}}\\
&=\sum_{k=0}^{n}{\binom{n}{k}i^k}\\
&=\binom{n}{0}i^0+\binom{n}{1}i^1+\binom{n}{2}i^2+\binom{n}{3}i^3+ \dots
\end{align}
$$
$i^k$ has 4 values for k, be aware '$k \equiv 1 \pmod 4$' means remainder of division of $k$ by $4$ is $1$.
$$
\begin{align}
k \equiv 0 \pmod 4 & \Rightarrow i^k=i^0=i^4=\dots=1 \\
k \equiv 1 \pmod 4 & \Rightarrow i^k=i^1=i^5=\dots=i\\
k \equiv 2 \pmod 4 & \Rightarrow i^k=i^2=i^6=\dots=-1\\
k \equiv 3 \pmod 4 & \Rightarrow i^k=i^3=i^7=\dots=-i
\end{align}
$$
so
$$
\begin{align}
\sum_{k=0}^{n}{\binom{n}{k}i^k}&=\binom{n}{0}+\binom{n}{1}i-\binom{n}{2} -\binom{n}{3}i+\binom{n}{4}+\dots
\end{align}
$$
