Problem

Source: 2020HKTST1 Q6

Tags: combinatorics



For a sequence with some ones and zeros, we count the number of continuous runs of equal digits in it. (For example the sequence $011001010$ has $7$ continuous runs: $0,11,00,1,0,1,0$.) Find the sum of the number of all continuous runs for all possible sequences with $2019$ ones and $2019$ zeros.