Help with hard complex numbers We had the topic of complex numbers for my senior math team meet this week, and I wasn't able to solve two of the problems.        
1.) $z=i^{\displaystyle \left(i^{\displaystyle \left(i^{(2)}\right)}\right)}$ and $a$ is the real part of $z$, find the lowest positive value of $\ln(a)$
[ I know it comes to $i-i$ but I don't know why that is e^(pi/2)] 
2.) $$\left[\cos \left(\frac{2\pi}{7}\right) + \cos \left(\frac{4\pi}{7}\right) + \cos \left(\frac{8\pi}{7}\right)\right]^2$$
[I think I can use de moivre's forumla, but I dont know how here]
It's non calculator and the answers are $\frac{\pi}{2}$ and \frac{1}{4}$ respectively. I just want to know how to solve them, thanks.
 A: For the first, it is equal to $i^{-i}.$ So, the log is equal to $-i(\pi i/2 + 2ki\pi) = \pi/2 +2 k  \pi.$
The second, before you square, you have the real part of $x=\omega + \omega^2 + \omega^4,$ where $\omega$ is the primitive seventh root of unity. Notice that the conjugate of this expression is $\omega^6 + \omega^5 + \omega^3 = 1-x.$ Since the real part of $x$ is the same as that of $\overline{x},$ we have that the real part of $x$ is $1/2,$ so its square is $1/4.$
A: Euler's formula says $e^{i\pi} = -1$
Take the square root of both sides
$e^{\frac{i\pi}{2}} = \sqrt{-1} = i$
Raise both sides to the -i power
${(e^{\frac{i\pi}{2}})}^{-i} = e^{\frac{\pi}{2}} = i^{-i}$
A: Here is an approach

$$ i^{-i}=e^{-i\ln i} = e^{-i \left(\ln |i|+i\left(\frac{\pi}{2}+2k\pi \right)\right)}=  e^{ \left(\frac{\pi}{2}+2k\pi \right)}.$$

Now, if you take $k=0$, you get $e^{\pi/2}$. 
A: Okay, the second one took me some time but I solved it, sorry if I do not know how to write math in this program.
I will use 2 pieces of data, the first:
$(e^x)^i = cos(x)+i*sin(x)$ [Euler's identity]
The second [I don know the name, but is easy to prove]:
if you add the n nth roots of 1 you get 0.
$1+(-1) = 0$
$1+e^{\frac{2\pi i}{3}}+e^{\frac{-2\pi i}{3}}=0$
$1+i-1-i=0$
etc...
Now: $0=e^{\pi i \frac{0}{7}}+e^{\pi i \frac{2}{7}}+e^{\pi i \frac{4}{7}}+e^{\pi i \frac{6}{7}}+e^{\pi i \frac{8}{7}}+e^{\pi i \frac{10}{7}}+e^{\pi i \frac{12}{7}}$
(The 7 roots of 1 added up equal 0)
$S=\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})$
$S=\frac{1}{2}\big[\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})\big]=$
$\frac{1}{2}\big[\cos(\frac{2\pi}{7})+\cos(\frac{4\pi}{7})+\cos(\frac{6\pi}{7})=\cos(\frac{8\pi}{7})+\cos(\frac{10\pi}{7})+\cos(\frac{12\pi}{7})+\cos(0)-cos(0)\big]$
$=\frac{1}{2} Re(e^{\pi i \frac{0}{7}}+e^{\pi i \frac{2}{7}}+e^{\pi i \frac{4}{7}}+e^{\pi i \frac{6}{7}}+e^{\pi i \frac{8}{7}}+e^{\pi i \frac{10}{7}}+e^{\pi i \frac{12}{7}}+e^{\pi i \frac{0}{7}}-e^{\pi i \frac{0}{7}})$=
$Re(0-e^{\frac{0\pi}{7}})$
[sum of roots equals 0]
$S = \frac{Re(-e^0)}{2} = \frac{-1}{2}$
$S^2 = \frac{1}{4}$
So your answer is $\frac{1}{4}$, the problem is hard but solvable
