MathDB
sum of the costs of all antipalindromic sequences of length 2020

Source: 2020 New Zealand MO Round 2 p5 NZMO

September 22, 2021
combinatorics

Problem Statement

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