Derangement with repetition (PRMO 2019, Problem 27)


We will say that a rearrangement of the letters of a word has no fixed letters if, when the rearrangement is placed directly below the word, no column has the same letters repeated. For instance, H B R A T A is a rearrangement with no fixed letters of B H A R A T. How many distinguishable rearrangements with no fixed letters does B H A R A T have? ( The two As are considered identical. )