Consider the sequential search algorithm for a sequence of size n, in the case where the desired item is guaranteed to be in the sequence. A recurrence describing the number of elements comparisons required is t(n) = 1 + t(n-1), which has the solution t(n) = an + b. Since t(0) = 0 and t(1) = 0, we have 0 = a0 + b and 0 = a1+ b, so 0 = a and therefore 0 = b. So the sequential search algorithm takes no time at all.
The example suggests that we are really looking at sequences of bit strings, so consider the following algorithm for constructing a sequence of 2n different bit strings.
For n=1, use the sequence (0 1). For n>1, recursively construct two identical copies of a sequence for n-1, prefix all strings in the first sequence by 0, and prefix all strings in the second sequence by 1. Finally, concatentate the new first sequence with the reverse of the second sequence. So for example, for n=2 we start with (0 1), get the two new sequences (00 01) and (10 11), and reverse and concatenate to get (00 10 01 11).
Let A(n) be the total number of switches needed to be flipped, using the sequence generated by this algorithm with input n. Set up, and solve exactly, a recurrence for A(n).