<s>[INST] Complex number: calculate $(1 + i)^n$. I have to solve the following complex number exercise: calculate $(1 + i)^n\forall n\in\mathbb{N}$ giving the result in $a + ib$ notation.
Basically what I have done is calculate $(1 + i)^n$ for some $n$ values.
$$(1 + i)^1 = 1 + i$$
$$(1 + i)^2 = 2i$$
$$(1 + i)^3 = - 2 + 2i$$
$$\boxed{(1 + i)^4 = - 4}$$
$$(1 + i)^5 = (1 + i)^4\cdot(1 + i)^1 = (-4)\cdot(1 + i) = - 4 - 4i$$
$$(1 + i)^6 = (1 + i)^4\cdot(1 + i)^2 = (-4)\cdot2i = - 8i$$
$$(1 + i)^7 = (1 + i)^4\cdot(1 + i)^3 = (-4)\cdot(- 2 + 2i) = 8 - 8i$$
$$(1 + i)^8 = (1 + i)^4\cdot(1 + i)^4 = (-4)\cdot(-4) = (-4)^2 = 16$$
We can write $n = 4\cdot q + r$ (Euclidean division), so we have:
$$(1 + i)^n = (1 + i)^{(4\cdot q + r)} = ((1 + i)^4)^q\cdot(1 + i)^r = (-4)^q\cdot(1 + i)^r$$
Finally if you want to calculate say... $(1 + i)^n$ for $n = 625$ you have:
$$625 = 4\cdot156 + 1\Rightarrow q = 156, r = 1$$
$$(1 + i)^{625} = (-4)^{156}\cdot(1 + i)^1 = (-4)^{156} + (-4)^{156}i$$
What other approach would you suggest? Mine works, but you have to find $q$ and $r$ in order to do the calculation, and I think it is not "calculate" technically speaking which was what the exercise is asking (although I am not sure what they mean by calculate).
 [/INST] Perhaps, proceed via the trigonometric form using De Moivre's formula:
$$\left(1+i\right)^{n}=2^{\frac{n}{2}}\left(\cos\frac{\pi}{4}+i\sin\frac{\pi}{4}\right)^{n}=2^{\frac{n}{2}}\cos\frac{\pi n}{4}+i2^{\frac{n}{2}}\sin\frac{\pi n}{4}$$
</s>