Sum of the coefficients of the characteristic polynomial of periodic matrices Let $M$ be an integer matrix with determinant equal to one (or maybe also minus one, but I did not do any tests for this case) and assume that $M$ is periodic, that is $M^n$ is the identity matrix for some $n$. Let $p_M$ denote the characteristic polynomial of $M$.

Question 1: Is it true that then $p_M(1) \geq 0$ for periodic matrices $M$?


Question 2: Let $a_n$ be the largest period of a matrix in $Sl_n(\mathbb{Z})$. What is $a_n$? (or is there a good bound?)

For $n=2$ it should be $a_n=6$. Is $a_n$ attained at a matrix with entries only in $\{-1,0,1\}$?
 A: Q1: This was already given in the comments, but: a matrix $M \in GL_k(\mathbb{Z})$ of finite order $n$ must have rational normal form a block-diagonal matrix with blocks the companion matrices of cyclotomic polynomials $\Phi_d$ for $d | n$, so the problem reduces to the case of a single such matrix, which is to say the problem reduces to asking whether we always have $\Phi_d(1) \ge 0$. This is true, and in fact:

Proposition: $\Phi_n(1)$ is equal to $p$ if $n = p^k$ is a prime power and equal to $1$ otherwise.

Proof. $\Phi_p(x) = \frac{x^p - 1}{x - 1}$ and $\Phi_{p^k}(x) = \Phi_p(x^{p^{k-1}})$ so the computation in the prime power case is clear. For a general $n$ we have that if $p \nmid m$ then
$$\Phi_{pm}(x) = \frac{\Phi_m(x^p)}{\Phi_m(x)}$$
and hence that $\Phi_n(1) = 1$ as soon as $n$ has more than one prime factor. $\Box$
Q2: As before it suffices to consider block sums of companion matrices of cyclotomic polynomials. A block sum of companion matrices of cyclotomic polynomials $\Phi_{d_i}(x)$ is an element of $GL_n(\mathbb{Z})$ where $n = \sum \varphi(d_i)$ of order $\text{lcm}(\{ d_i \})$ so the problem is to optimize this (the cyclotomic polynomials satisfy $\Phi_n(0) = 1$ for $n \ge 2$ so all these block matrices lie in $SL_n(\mathbb{Z})$ also). This looks hard in general.
The corresponding problem of finding the largest order of an element of $S_n$ is a similar optimization problem but where $n = \sum d_i$. That sequence is Landau's function (A000793) but I don't know if this one has a name or is in the OEIS.
Edit #1: If $L(n)$ denotes this largest order then we have

*

*$L(1) = 2$ ($1 = \varphi(2)$)

*$L(2) = 6$ ($2 = \varphi(6)$)

*$L(3) = 6$ ($3 = \varphi(6) + \varphi(2)$)

*$L(4) = 12$ ($4 = \varphi(6) + \varphi(4)$)

*$L(5) = 12$ ($5 = \varphi(6) + \varphi(4) + \varphi(2)$)

*$L(6) = 30$ ($6 = \varphi(10) + \varphi(6)$)

which, if I haven't messed up, already shows that this sequence is not in the OEIS. On the other hand, it's not hard to see that $L(2k+1) = L(2k)$ for $k \ge 1$ since $\varphi(d)$ is even for $d \ge 2$ and $\varphi(2d) = \varphi(d)$ if $d$ is odd so it never helps us to add a $\varphi(2) = 1$ term to the sum. (We need to rule out the possibility that $L(n)$ is a power of $2$ but this shouldn't be hard.) So perhaps the OEIS has only the even terms $L(2n)$ somewhere; I haven't ruled that out yet.
An easy upper bound is that we can compute the exponent $E(n)$, namely the lcm of all orders of elements of finite order in $GL_n(\mathbb{Z})$, so that $L(n) | E(n)$. By considering each prime separately we have that
$$\nu_p(E(n)) = \text{max} \left\{ k : \varphi(p^k) = (p - 1) p^{k-1} \le n \right\} = \left\lfloor \log_p \frac{n}{p-1} \right\rfloor + 1$$
and hence
$$E(n) = \prod_p p^{ \left\lfloor \log_p \frac{n}{p-1} \right\rfloor + 1}.$$
This sequence is much easier to compute although the bound becomes increasingly bad. It does have the virtue of also being a bound on the exponent of any finite subgroup of $GL_n(\mathbb{Z})$. We again have $E(2k+1) = E(2k)$ for $k \ge 1$, and

*

*$E(1) = 1$

*$E(2) = E(3) = 6$

*$E(4) = E(5) = 2^3 \cdot 3 \cdot 5 = 120$

*$E(6) = E(7) = 2^3 \cdot 3^2 \cdot 5 \cdot 7 = 2520$
which also does not appear to be in the OEIS, with or without the terms doubled. The corresponding sequence for $S_n$ is $\text{lcm}(1, 2, \dots n)$ which is A003418 and the formula is similar except the exponent is more simply just $\lfloor \log_p n \rfloor$.
Edit #2: Okay, I computed that $L(8) = 60$ which was finally enough terms for me to find it: $L(2n)$ appears to be (up to some indexing issues) A005417 on the OEIS. A comment there suggests the following argument which makes $L$ a bit easier to compute than I had been thinking: if $\gcd(n, m) = 1$ and $\varphi(n), \varphi(m) \ge 2$ (so neither $m$ nor $n$ is equal to $2$) then we can always replace a $\Phi_{mn}(x)$ block with a $\Phi_n(x)$ block and a $\Phi_m(x)$ block, since $\varphi(mn) = \varphi(m) \varphi(n) \ge \varphi(m) + \varphi(n)$. So we only ever need to consider $\Phi_d(x)$ blocks where $d$ is a prime power or twice an odd prime power. A similar argument works in $S_n$. It follows (this is the OEIS comment) that
$$L(n) = \text{max} \left\{ \prod p_i^{e_i} : \sum (p_i - 1) p_i^{e_i - 1} \le n \right\}.$$
Edit #3: The observation in the previous paragraph answers Q3: yes, the maximum is attained for a matrix with entries in $\{ -1, 0, 1 \}$, since the same is known about the cyclotomic polynomials $\Phi_d(x)$ where $d$ is a prime power or twice an odd prime power. Famously the cyclotomic polynomials are known to not always have coefficients in $\{ -1, 0, 1 \}$ and $\Phi_{105}(x)$ is the smallest counterexample, but that doesn't matter here.
Edit #4: Okay, here are some bounds. For a lower bound we clearly have $g(n) \le L(n)$. For an upper bound let $r_i = (p_i - 1) p_i^{e_i - 1}$, so that we can write the optimization problem defining $L(n)$ as
$$L(n) = \text{max}\left\{\prod \frac{p_i}{p_i - 1} r_i : \sum r_i \le n \right\}.$$
We can bound this factor $\prod \frac{p_i}{p_i - 1}$ as follows. The primes occurring in this product are at worst the primes up to $n+1$, and I believe the asymptotic behavior of $\prod_{p_i \le n+1} \frac{p_i}{p_i - 1}$ should be $\log n$ but I don't see an extremely clean proof so I'll settle for the worse bound
$$\prod_{p_i \le n+1} \frac{p_i}{p_i - 1} \le \prod_{k=2}^{n+1} \frac{k}{k-1} = n+1$$
which gives
$$L(n) \le \text{max} \left\{ (n+1) \prod r_i : \sum r_i \le n \right\}.$$
We can now relax this optimization problem so that the $r_i$ can take real values, and then a standard Lagrange multiplier argument shows that, for any number $k$ of terms (which we've left unspecified), we want to take $r_i = r$ for some fixed $r$. This gives
$$L(n) \le \text{max} \left\{ (n+1) r^k : kr \le n, k \in \mathbb{N}, r \in \mathbb{R} \right\}$$
and if we further relax $k$ to a real number then a standard calculus argument gives $r = e, k = \frac{n}{e}$, so
$$\boxed{ L(n) \le (n+1) \exp \left( \frac{n}{e} \right) }$$
exactly paralleling the analogous but slightly simpler argument for Landau's function which gives $g(n) \le \exp \left( \frac{n}{e} \right)$. I would guess that in fact like $g(n)$ we should also have $\log L(n) \sim \sqrt{n \log n}$. I think the starting point is that the relaxation we used above is very inaccurate for large primes and for $p$ such that $(p-1)p > n$ the corresponding exponent is at most $1$.
