MathDB
A binary game - change streaks of digits until it ends

Source: 38th Brazilian MO (2016) - First Day, Problem 3

November 23, 2016
combinatoricsBrazilian Math Olympiad 2016Brazilian Math OlympiadgamesCombinatorial games

Problem Statement

Let it kk be a fixed positive integer. Alberto and Beralto play the following game: Given an initial number N0N_0 and starting with Alberto, they alternately do the following operation: change the number nn for a number mm such that m<nm < n and mm and nn differ, in its base-2 representation, in exactly ll consecutive digits for some ll such that 1lk1 \leq l \leq k. If someone can't play, he loses.
We say a non-negative integer tt is a winner number when the gamer who receives the number tt has a winning strategy, that is, he can choose the next numbers in order to guarrantee his own victory, regardless the options of the other player. Else, we call it loser.
Prove that, for every positive integer NN, the total of non-negative loser integers lesser than 2N2^N is 2Nlog(min{N,k})log22^{N-\lfloor \frac{log(min\{N,k\})}{log 2} \rfloor}