I want to know how to solve this question. I found this question in an online test but was not able to find the answer. Later after the test, when I reviewed the test, it showed the answer as $4$ but I want to know how the answer ends up in $4$.
I tried a lot but wasn’t able to find the answer.
Keep in mind that I’m a beginner and $a,b$ and $c$ belong to $Z^+$ and $n$ belongs to $Z$
Thanks in Advance
Fermart last theorem says that if $a,b,c,n\in\mathbb{Z}$ with $n\ge3$, then the equation $a^n+b^n=c^n$ means that at least one of $a,b,c$ are zero.
So, $n<3$. If $n\le-3$, $-n\ge3$, we have $$\begin{split}a^n+b^n&=c^n\\\bigg(\frac1a\bigg)^{-n}+\bigg(\frac1b\bigg)^{-n}&=\bigg(\frac1c\bigg)^{-n}\\(abc)^{-n}\Bigg(\bigg(\frac1a\bigg)^{-n}+\bigg(\frac1b\bigg)^{-n}\Bigg)&=(abc)^{-n}\bigg(\frac1c\bigg)^{-n}\\(bc)^{-n}+(ac)^{-n}&=(ca)^{-n}\end{split}$$
which has no solutions from Fermart Last Theorem.
So it remains to check the case when $n=-2,-1,0,1,2$. The casework is left for an exercise.