Baltić, V. (2012). Applications of the finite state automata for counting restricted permutations and variations. Yugoslav Journal of Operations Research, 22(2), 183–198. https://doi.org/10.2298/YJOR120211023B