Given,
$$z^2+z+1=0$$
Since
$$z^3-1=(z-1)(z^2+z+1)$$ and $$z\ne1$$
we get $$z^3=1$$
Also,
$$\frac1z=z^2$$
Therefore,
$$z^k+\frac1{z^k}=z^k+z^{2k}$$
Now consider values according to
$$k\pmod 3$$
If $$k\equiv0\pmod3$$ then $$z^k=1$$ and $$z^{2k}=1$$
Hence
$$z^k+\frac1{z^k}=2$$
Therefore,
$$\left(z^k+\frac1{z^k}\right)^2=4$$
If
$$k\equiv1\pmod3$$
then
$$z^k+\frac1{z^k}=z+z^2$$
Using
$$1+z+z^2=0$$
we get
$$z+z^2=-1$$
Therefore,
$$\left(z^k+\frac1{z^k}\right)^2=1$$
Similarly, if
$$k\equiv2\pmod3$$
then
$$z^k+\frac1{z^k}=z^2+z=-1$$
and again
$$\left(z^k+\frac1{z^k}\right)^2=1$$
Hence the terms repeat as
$$1,\;1,\;4,\;1,\;1,\;4,\ldots$$
Every block of 3 terms contributes
$$1+1+4=6$$
Now,
$$100=3\times33+1$$
So there are
$$33$$
complete blocks and one extra term.
Contribution of
$$33$$
blocks:
$$33\times6=198$$
The extra term corresponds to
$$k=100\equiv1\pmod3$$
whose value is
$$1$$
Therefore,
$$\sum_{k=1}^{100}\left(z^k+\frac1{z^k}\right)^2=198+1$$
$$=199$$
Final Answer :
$$199$$