Integer matrices with no integer eigenvalues Let $$A = \begin{pmatrix} 3&1 \\  0&1 \end{pmatrix}$$ and $$B = \begin{pmatrix} 1&0\\ 1&2 \end{pmatrix}$$ I want to show that the only elements of the semigroup generated by $A$ and $B$ that have integer eigenvalues are elements of the form $A^n$ and $B^n$, where $n \in \mathbb{N}$. I have tried every way that I can think of. Is it possible that a problem like this is undecidable? 
 A: I just found this problem. If you try the matrix $A^nB^m$, then your question for such matrices is equivalent to this number theory question: Can 
$9^n+2\cdot 9^n\cdot 2^m-12\cdot 3^n\cdot 2^m+2\cdot 3^n+4^{m}\cdot 9^n+4^{m}+2\cdot 2^m+9$ 
be a square provided $m,n\ne 0$. Note that if we denote $3^n$ by $x$, $2^m$ by $y$, we get a quartic polynomial in $x,y$. I hope number theorists here can say something about this exponential Diophantine equation. 
The answer to problem with question mark is "obviously NO". To be undecidable, you should have a mass problem. For given $A,B$, you have the following problem: 
given a product $W(A,B)$ is it true that the matrix has an integer eigenvalue. That problem is obviously decidable. The question of whether this is true for every word $W$ requires answer "yes" or "no" and is not a mass problem. You can still ask whether it is independent from ZF or even ZFC (or unprovable in the Peano arithmetic). What Bjorn had in mind is a completely different and much harder problem when you include $A, B$ in the input and ask if for this $A$, $B$ some product $W(A,B)$ not of the form $A^n, B^m$ has an integer eigenvalue. This is a mass problem which could be undecidable (although he, of course, did not prove it). But this has nothing to do with the original question.   
A: The general problem of this type is undecidable.  More precisely, there is no algorithm that takes as input two $n \times n$ integer matrices and decides whether the semigroup they generate contains a matrix all of whose eigenvalues are integers.
Proof: Given two $n \times n$ integer matrices $A$ and $B$, choose a prime $p \ge 5$ such that $p>n$, choose a degree $p$ monic integral polynomial $f(x)$ with the full symmetric group $S_p$ as Galois group, let $C$ be a $p \times p$ integer matrix with characteristic polynomial $f(x)$, and consider the tensor products (Kronecker products) $A \otimes C$ and $B \otimes C$.  An element of the semigroup generated by these two $np \times np$ matrices has the form $M \otimes C^m$ for some $M$ in the semigroup generated by $A$ and $B$ and some $m \ge 1$.  Each eigenvalue of $M$ is of degree at most $n$ over $\mathbf{Q}$, but each eigenvalue of $C^m$ is of degree exactly $p$, so the eigenvalues of $M \otimes C^m$ are all integers if and only if the all eigenvalues of $M$ are $0$, which holds if and only if $M$ is nilpotent.  Thus the semigroup generated by $A \otimes C$ and $B \otimes C$ contains a matrix all of whose eigenvalues are integers if and only if the semigroup generated by $A$ and $B$ contains the zero matrix.  But the latter property is undecidable: see Chapter 3 of this survey article.  Thus one cannot have an algorithm that would answer the integer eigenvalue question for $A \otimes C$ and $B \otimes C$ in general.
