
Background
An \$n\$-bit Gray code is an ordering of \$2^n\$ binary sequences so that adjacent sequences always differ by exactly one bit.
A Beckett-Gray code is a special kind of Gray code. In addition to being a Gray code, it has the following characteristics:
It is cyclic: the last bit pattern...