Multiplying M by any matrix A would return new matrix, B, in which
• the 1st row of B is equal to the 4th row of A,
• the 2nd row of B is equal to the 3rd row of A,
• the 3rd row of B is equal to the 2nd row of A,
• the 4th row of B is equal to the 5th row of A, and
• the 5th row of B is equal to the 1st row of A.
The pattern here is
1 => 4 => 5 => 1
2 => 3 => 2
Let {4, 3, 2, 5, 1} denote the matrix M, where each number refers to the row of the identity matrix, I.
Using this notation, the pattern above gives
M² = {5, 2, 3, 1, 4}
M³ = {1, 3, 2, 4, 5}
M⁴ = {4, 2, 3, 5, 1}
M⁵ = {5, 3, 2, 1, 4}
M⁶ = {1, 2, 3, 4, 5}
so that <em>n</em> = 6.
(Notice that the first cycle has length 3 and the second one has length 2; the minimum <em>n</em> needed here is then LCM(2, 3) = 6.)