When does this equation have a solutions in integers: $ z ^ x + \bar z ^ y = 1 $? Let $ z $ be a complex number such that $ z = \alpha + i \beta $, where $ \alpha$ and $\beta$ are integers. Let $ \bar z $ be the complex conjugate of $ z $, and let $ x $ and $ y $ be integers.

When does the following equation have a solutions in integers?
$$ z ^ x + \bar z ^ y = 1 $$


First of all, if you accept that $0^0=1$, then there are some trivial solutions:
Let $z$ be $0$ and let one of $x$ and $y$ be $0$ and the other one be any
positive integer, and you will have $z^x+\bar z^y=0+1=1$. It's easy to see that
if one of $x$, $y$ and $z$ is equal to $0$, then the above cases are the only
possible solutions.
So, from now on, we'll assume that none of $x$, $y$ and $z$
is equal to $0$. Note that in this case, we'll have $\left|z\right|\geq1$,
because $\alpha$ and $\beta$ are integers and at least one of them is nonzero.
Next, we will show that if $z^x+\bar z^y=1$, then $\left|z\right|\leq2$.


*

*If $x>0$ and $y>0$ then $\left|z\right|^{-2x}\leq1$. Also by
$z^x+\bar z^y=1$ we get $\bar z^x+z^y=\bar 1=1$. By multiplying these equations
we have $\left|z\right|^{2x}+\left|z\right|^{2y}+z^x\bar z^y+\bar z^x z^y=1$.
Now suppose that $x\leq y$ (the case $y\leq x$ is similar). From the last
equation we have $\left|z\right|^{2x}+\left|z\right|^{2y}+\left|z\right|^{2x}
(\bar z^{y-x}+z^{y-x})=1$ that yields $1+\left|z\right|^{2y-2x}+
(\bar z^{y-x}+z^{y-x})=\left|z\right|^{-2x}$ which is equivalent to
$1+\left|z\right|^{2y-2x}+2\Re(z^{y-x})=\left|z\right|^{-2x}$. Now because
$\alpha$ and $\beta$ are integers, the left side of the last equation is an
integer. But the right side is no more than $1$ and so it's an integer if and
only if $\left|z\right|=1$. That gives $\left|z\right|\leq2$.

*If $x>0$ and $y<0$ then $\left|z\right|^x\geq\left|z\right|$ and
$\left|z\right|^y\leq1$. So, by triangle inequality, we get
$\left|z\right|\leq\left|z\right|^x\leq\left|z\right|^y+\left|z^x+
\bar z^y\right|\leq2$. The case $y>0$ and $x<0$ is similar.

*If $x<0$ and $y<0$ then $\left|z\right|^{-x}\geq\left|z\right|$ and
$\left|z\right|^{-y}\geq\left|z\right|$. Now, because $z^x+\bar z^y=1$, we have
$z^{-x}+\bar z^{-y}=z^{-x}\bar z^{-y}$ and by triangle inequality we get
$\left|z\right|^{-(x+y)}=\left|z^{-x}\bar z^{-y}\right|=
\left|z^{-x}+\bar z^{-y}\right|\leq\left|z\right|^{-x}+\left|z\right|^{-y}$
which gives $(\left|z\right|^{-x}-1)(\left|z\right|^{-y}-1)\leq1$. Therefore,
$(\left|z\right|-1)^2\leq1$ which yields $\left|z\right|\leq2$.


Next, we show that $\left|z\right|\neq1$. If $\left|z\right|=1$ then $z=\pm1$ or
$z=\pm i$. In the former case, $z^x+\bar z^y$ is an even integer and can't be
equal to $1$. In the latter case, if $x$ and $y$ have the same parity, then
$z^x+\bar z^y$ is an even multiple of $i$, and if they have different parities,
then $z^x+\bar z^y$ will have a nonzero imaginary part. So in either case, the
equation $z^x+\bar z^y=1$ won't hold. So the only possible values for $z$ are
$\pm2$, $\pm2i$, $\pm(1+i)$ and $\pm(1-i)$.
Now, we're ready for determining all the possible solutions.


*

*If $x>0$ and $y>0$ then $\left|z\right|$ must be equal to $1$ as we proved before. But we also proved this is impossible.

*If $x>0$ and $y<0$ then $\left|z\right|^y<1$ because $\left|z\right|^y
\neq1$. So in the inequality $\left|z\right|^y\leq2$ that was derived before,
the equality can't hold. Therefore $z$ is equal to $\pm(1+i)$ or $\pm(1-i)$ and
we have $\left|z\right|=\sqrt{2}$. Now, if $x\geq2$ then $2\leq\left|z\right|^x
\leq\left|z^x+\bar z^y\right|+\left|z\right|^y\leq1+\frac{1}{\sqrt{2}}$ which
leads to a contradiction. So the only possible value for $x$ is $1$. This means
$\Im(z^x)=\pm1$. On the other hand, $\left|\Im(\bar z^y)\right|\leq
\left|z\right|^y\leq\frac{1}{\sqrt{2}}$ so $\Im(z^x+\bar z^y)\neq0$ and
therefore there are no possible solutions in this case either. The case $x<0$
and $y>0$ is similar.

*If $x<0$ and $y<0$ and $\left|z\right|=2$ then
$\left|z\right|^x\leq\frac{1}{2}$ and $\left|z\right|^y\leq\frac{1}{2}$ and
equality holds iff $x=-1$ and $y=-1$ respectively. By triangle inequality we get
$\left|z^x+\bar z^y\right|\leq\left|z\right|^x+\left|z\right|^y\leq1$ so the
equalities must hold. By simple calculation, we see that only the case $z=2$
gives a solution.
If $x<0$ and $y<0$ and $\left|z\right|=\sqrt{2}$ then
$\left|z\right|^x\leq\frac{1}{\sqrt{2}}$ and
$\left|z\right|^y\leq\frac{1}{\sqrt{2}}$. If $x$ is equal to $-1$ then $y$ must
be equal to $-1$ too. Because $\left|\Re(z^x)\right|$ would be equal to
$\frac{1}{2}$ but if $y=-2$ then $\Re(\bar z^y)=0$ and if $y<-2$ then
$\left|\Re(\bar z^y)\right|\leq\left|z\right|^y=\frac{1}{2\sqrt{2}}$ and in
either case $z^x+\bar z^y\neq1$ (Similarly if $y=-1$ then $x=-1$). Because
$\Re(z^{-2})=\Re(\bar z^{-2})=0$ the case $x=y=-2$ is impossible. If $x\leq-2$
and $y\leq-3$ then because $\left|z^x\right|+\left|\bar z^y\right|\leq
\frac{1}{2}+\frac{1}{2\sqrt{2}}<1$, we won't have a solution and the case
$x\leq-3$ and $y\leq-2$ is similar. So in the only possible solutions, we have
$x=y=-1$. By simple calculation, we see that only $z=1\pm i$ gives a solution.


Hence, the only nontrivial solutions are $(x,y,z)=(-1,-1,2)$ and
$(x,y,z)=(-1,-1,1\pm i)$.
