How can I tell if a bit pattern can represent offset gray-code?
Yes. Any bit pattern can represent an offset gray-code number. Gray code is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit).To fully understand it you need and example and compare with default binary.
In binary:
1-&gt; 0001  
2-&gt; 0010   
3-&gt; 0011

You can see that in binary when incrementing from 1 to 2, there are happening two bit operations. One is that the first bit turns off and second the 2'nd bit lights up. So this violates the rule of gray-code - &quot;two successive values differ in only one bit&quot;.
In gray code it would look like this:
1-&gt; 0001  
2-&gt; 0011  
3-&gt; 0010  

Can you see the difference?
When we incremented from 1 to 2, the first bit didn't turned off anymore and the second lighted up. So only one bit operation happened.
You can also check out this article which has a C program that generates gray-codes between 1-32 bits.
Using-Gray-Codes