Let be a prime. Compute the Jordan canonical form over the finite field of the matrix whose every entry is 1. (.)
Let . Now the computation in this previous exercise holds over (indeed, over any ring with 1), and so we have .
If is not divisible by , then is a unit in . If is an eigenvector with eigenvalue , then evidently (as we saw in the exercise referenced above) . So the eigenspace of has dimension 1, the characteristic polynomial of is , and the Jordan canonical form of is where and otherwise.
Suppose divides . Since , the minimal polynomial of is now . We claim that the remaining invariant factors of are . There is probably a slick linear-algebraic way to argue this, but I don’t see it. Instead I will show explicitly that is similar to a matrix in Jordan canonical form. (If anyone can offer a simplification of this proof I’d be grateful!)
If , then the minimal polynomial of is the only invariant factor, so the Jordan form of is . Suppose .
Let have dimension , and let be the matrix whose every entry is 1. Note that and . Let and . Evidently , so that . Moreover, we have , and .
Now let have dimension . Let and . Evidently, , so that . Now , and we have . If we squint just right, this matrix is in Jordan canonical form, and is similar to .