MathDB
Triangle from bits

Source: Bulgaria EGMO TST 2019 Day 2 Problem 1

February 3, 2023
combinatoricscountingabstract algebra

Problem Statement

Let x1,,xnx_1,\ldots,x_n be a sequence with each term equal to 00 or 11. Form a triangle as follows: its first row is x1,,xnx_1,\ldots,x_n and if a row if a1,a2,,ama_1, a_2, \ldots, a_m, then the next row is a1+a2,a2+a3,,am1+ama_1 + a_2, a_2 + a_3, \ldots, a_{m-1} + a_m where the addition is performed modulo 22 (so 1+1=01+1=0). For example, starting from 11, 00, 11, 00, the second row is 11, 11, 11, the third one is 00, 00 and the fourth one is 00.
A sequence is called good it is the same as the sequence formed by taking the last element of each row, starting from the last row (so in the above example, the sequence is 10101010 and the corresponding sequence from last terms is 00100010 and they are not equal in this case). How many possibilities are there for the sequence formed by taking the first element of each row, starting from the last row, which arise from a good sequence?