L. Carlitz has a paper, [Classes of pairs of commuting matrices over a finite field](https://www.jstor.org/stable/2312894), that computes the number of simultaneous similarity classes of of pairs of commuting matrices in $\operatorname{Mat}\_n(\mathbb F\_q)$. Two pairs $(A,B)$ and $(A',B')$ are called **simultaneously similar** if there is $U\in \operatorname{GL}\_n(\mathbb F\_q)$ such that $A'=UAU^{-1}$, $B'=UBU^{-1}$.


However, from the proof (specifically, to go from equation (4) to (5) on p. 193), it seems that he implicitly uses the statement that $(A,B)$ and $(A,B')$ belong to different similarity classes whenever $B\neq B'$. But it is possible that there is $U\in \operatorname{GL}\_n(\mathbb F\_q)$ that commutes with $A$ and such that $UBU^{-1}=B'$. In this case, they belong to the same class.


Is that it? If this paper turns out to be wrong, is there any result about the same question?



Is Carlitz's paper correct about the number of similarity classes of commuting matrices?
It is wrong. See [the correction published in AMM **71** (1964), issue 8, page 900](https://sci-hub.se/https://www.tandfonline.com/doi/abs/10.1080/00029890.1964.11992349). (You have to scroll down to the bottom of the last page to find this correction.)


Unfortunately this was published in the "Mathematical Notes" section, making it hard to find (as these notes are not individually indexed much of the time, and don't get separate DOIs). I've only managed to find it by looking at [the back references to Carlitz's original paper](https://scholar.google.com/scholar?cites=15620305770270339664&as_sdt=2005&sciodt=0,5&hl=en) (always a good first step if you suspect something is wrong in a paper; whoever cited it might too have noticed), and realizing that [one of these back references](https://sci-hub.se/https://www.sciencedirect.com/science/article/pii/0022314X71900412) also cites a correction.


