For each positive integer k, define r(k) as the number of runs of k in base-2, where a run is a collection of consecutive 0s or consecutive 1s without a larger one containing it. For example, (11100100)2 has 4 runs, namely 111−00−1−00. Also, r(0)=0. Given a positive integer n, find all functions f:Z→Z such that
k=0∑2n−12r(k)f(k+(−1)kx)=(−1)x+n for all integer x.Proposed by YaWNeeT Taiwan TSTTaiwancombinatoricsFunctional Equations