Find the cardinality of $\big\{(x,y,z)\mid x^2+y^2+z^2= 2^{2018}, xyz\in\mathbb{Z} \big\}$. 
What is the cardinality of set $\big\{(x,y,z)\mid x^2+y^2+z^2= 2^{2018},    xyz\in\mathbb{Z} \big\}$?

Since I have very limited knowledge in number theory, I tried using logarithms and then manipulating the equation so that we get $$10^{2018}+2=x^2+y^2+z^2.$$
Then setting one of $x,y,z$ equal to $\sqrt{2}$ we find all values of $x$ and $y$ where  $$2x^2+y^2=10^{2018}.$$
Finally we use combinatorics to get the required answer.
However this led to no-where.
What is the correct way to solve this problem?
 A: For $n \in \mathbb N$, consider the equation
$$ x^2 + y^2 + z^2 = 2^n $$
where $x,y,z$ are integers. Since $x \mapsto -x$, $y \mapsto -y$, $z \mapsto -z$ does not change the equation, we may assume $x,y,z \ge 0$. We may henceforth suppose $x \ge y \ge z$.
Note that there is no solution when $n=1$.
Suppose $n \ge 2$. Since $x^2+y^2+z^2$ is even, exactly one of $x,y,z$ is even, or all three are even. The first of these cases is ruled out since $a^2 \equiv 0\pmod{4}$ if $a$ is even and $a^2 \equiv 1\pmod{4}$ when $a$ is odd. Therefore, $x,y,z$ are all even.
Writing $x=2x_1$, $y=2y_1$, $z=2z_1$ gives
$$ x_1^2 + y_1^2 + z_1^2 = 2^{n-2}. $$
If $n-2=1$, there is no solution. If $n-2 \ge 2$, we repeat the above argument to arrive at the equation
$$ x_m^2 + y_m^2 + z_m^2 = 2^e, $$
where $e=0\:\text{or}\:1$.
The only solution in the case $e=0$ is $x_m=1$, $y_m=z_m=0$. There is no solution in the case $e=1$. From $x=2x_1=2^2x_2=\ldots=2^mx_m$, etc., we get $x=2^m$ when $n=2m$ is even, and $y=z=0$. There is no solution when $n$ is odd.
We conclude that the equation $x^2+y^2+z^2=2^n$ has no solution when $n$ is odd, and that the only solutions when $n$ is even are $(x,y,z)=\pm(2^{n/2},0,0)$, and its permutations, giving a total of six solutions. $\blacksquare$
