MathCastle
ChallengeMedium

Challenge · Medium problem

How many permutations a1a2⋯a6a_1a_2\cdots a_6 of 1,2,…,61,2,\dots,6 avoid the pattern 231231 (i.e. contain no indices i<j<ki<j<k with ak<ai<aja_k<a_i<a_j)?

Practice more like this