I found the question to be an uncommon and interesting problem in non-trivial combinatorics. Here's how I would approach it. I use fixed-pitch font for readability of alignments. I'll first list how to tackle small value of bit size, then deduce rules that can prune the tree. Say you consider binary values in natural increasing order. Say you call a value acceptable when it is the smallest value resulting from bit rotation of binary string of a given size. Re