Skip to content / Đến nội dung
ThichHocToan.com

MathNet 2020 — Math Olympiad Vault — Part 05 Question 14

Math Olympiad Vault · MathNet 2020 — Math Olympiad Vault — Part 05

Question 14

A sequence of $A$s and $B$s is called antipalindromic if writing it backwards, then turning all the $A$s into $B$s and vice versa, produces the original sequence. For example $A B B A A B$ is antipalindromic. For any sequence of $A$s and $B$s we define the cost of the sequence to be the product of the positions of the $A$s. For example, the string $A B B A A B$ has cost $1\cdot 4\cdot 5 = 20$. Find the sum of the costs of all antipalindromic sequences of length 2020.