MathDB
Permutation consisting of A&B

Source: 2021 Korea Winter Program Test2 Day2 #5

February 17, 2021
combinatoricspermutation

Problem Statement

For positive integers kk and nn, express the number of permutation P=x1x2...x2nP=x_1x_2...x_{2n} consisting of AA and BB that satisfies all three of the following conditions, using kk and nn.
(i)(i) A,BA, B appear exactly nn times respectively in PP.
(ii)(ii) For each 1in1\le i\le n, if we denote the number of AA in x1,x2,...,xix_1,x_2,...,x_i as aia_i ,, then 2aii1\mid 2a_i -i\mid \le 1.
(iii)(iii) ABAB appears exactly kk times in PP. (For example, ABAB appears 3 times in ABBABAABABBABAAB)