Some More Homework - Length of the B sequence

I’m working on my first problem, Some More Homework (code A6). I believe my answer is correct, however I have a problem with the length of the b sequence. In the example given, the length of this sequence is 16. Where did 16 come from? If I hardcode a few values into my program to force length of b to be 16, and give it the sample input, I get the exact output of the sample. However, since I don’t know how to determine the length of b to use, I set b to the same length as c…

I know I’m computing b correctly, even though I didn’t know until after that it’s the Thue-Morse sequence.

Anyway, if someone would take some time to look at my C# code, it’s right here.

Thanks in advance. Sigh…

//