Some years ago I was asked by a friend if Fermat's Last Theorem was true for matrices. It is pretty easy to convince oneself that it is not the case, and in fact the following statement occurs naturally as a conjecture:

For all integers $n,k\geq 2$ there exist three square matrices $A$, $B$ and $C$ of size $k\times k$ and integer entries, such that $\det(ABC)\neq 0$ and: $$A^n + B^n = C^n$$

Of course, the case $k=1$ is just Fermat's Last Theorem, but in that case the conclusion is the opposite for $n>2$.

I think that I read somewhere that it is known that the above assertion is true (I do not remember exactly where, and haven't seen anything on Google, but this old question on MSE, on which there is an old reference, that I think does not answer this).

Two observations that are pretty straightforward to verify are the following: the case $2\times 2$ and $3\times 3$ solve the general case $k\times k$ by putting suitable small matrices on the diagonal.

Also, as it is stated in a comment on that question, if the exponent $n$ is odd then the case $2\times 2$ can be solved by this example:

$$\begin{bmatrix} 1 & n^\frac{n-1}{2}\\ 0 & 1\end{bmatrix}^n + \begin{bmatrix} -1 & 0\\n^\frac{n-1}{2} & -1\end{bmatrix}^n = \begin{bmatrix} 0 & n\\1& 0\end{bmatrix}^n$$

Does anybody know of such examples in the $2\times 2$ case for even $n$, and the general $3\times 3$ case?

More clearly: are there easy and explicit examples for each $n$ and $k$ for the above conjecture?

  • 2
    $\begingroup$ Of possible interest, Niven, Ivan. Fermat’s theorem for matrices. Duke Math. J. 15 (1948), no. 3, 823--826. doi:10.1215/S0012-7094-48-01574-9. projecteuclid.org/euclid.dmj/1077475036, Mathematical Reviews number (MathSciNet) MR0026672, Zentralblatt MATH identifier 0032.00102 $\endgroup$ Commented Feb 14, 2020 at 21:03
  • 2
    $\begingroup$ @GerryMyerson: It is about a different Fermat theorem. $\endgroup$
    – user6976
    Commented Feb 15, 2020 at 1:11
  • 9
    $\begingroup$ E. Bolker, "Solutions of $A^k + B^k = C^k$ in $n \times n$ integral matrices”, American Mathematical Monthly, 75, 1968, 759-760. $\endgroup$ Commented Feb 15, 2020 at 19:44
  • 2
    $\begingroup$ Thanks Ethan, I've looked your paper and it's very nice. For the sake of completeness I just state here that Ethan proved that the equation $A^{2n}+B^{2n}=C^{2n}$ has an $n\times n$ solution. Something that just caught my attention was the fact that your suspicion on Remark 3 turned out to be wrong since the example here above settles it. Nevertheless, thank you for sharing this beautiful article. Let's hope someone will complete the remaining cases. $\endgroup$ Commented Feb 15, 2020 at 22:27
  • 3
    $\begingroup$ A JSTOR link to Ethan Bolker's article is here: jstor.org/stable/2315199 $\endgroup$ Commented Feb 16, 2020 at 17:23

2 Answers 2


This problem is addressed in "On Fermat's problem in matrix rings and groups," by Z. Patay and A. Szakács, Publ. Math. Debrecen 61/3-4 (2002), 487–494, which summarizes previous work on the topic and gives some new results. It seems that the problem is not completely solved.

When $k=2$, Khazonov showed that there are solutions in $SL_2(\mathbb Z)$ if and only if $n$ is not a multiple of 3 or 4, but I couldn't immediately find any statement anywhere about the case $4\mid n$ and $2\times 2$ integer matrices with nonzero determinant.

Khazanov also proved that $GL_3(\mathbb Z)$ solutions do not exist if $n$ is a multiple of either 21 or 96, and $SL_3(\mathbb Z)$ solutions do not exist if $n$ is a multiple of 48.

Patay and Szakács give explicit solutions for $SL_3(\mathbb Z)$ when $n=\pm 1\pmod 3$ as well as for $n=3$. Here's a solution for $n=3$: $$\pmatrix{0& 0&1\\ 0 &-1& 1\\ 1 & 1 & 0}^3 + \pmatrix{0&1&0\\ 0&1&-1\\ -1&-1&0}^3 = \pmatrix{0&1&1\\0&0&1\\1&0&0}^3.$$


For $k=2$ with $n \equiv 2 \mod 4$:

$$ \pmatrix{1 & (-1)^{(n-2)/4} 2^{n/2} n^{n-1} \cr 0 & 1}^n + \pmatrix{n & -n\cr n & n\cr}^n = \pmatrix{1 & 0\cr (-1)^{(n-2)/4} 2^{n/2} n^{n-1} & 1\cr}^n $$

An example for $n=4$ is $$ \pmatrix{3 & -2\cr 1 & 2\cr}^4 + \pmatrix{2 & -4\cr 2 & 0\cr}^4 = \pmatrix{1 & 2\cr -1 & 2\cr}^4 $$ but I don't have a generalization.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.