Show Gray Codes of a Given Length

A Gray code is an encoding of numbers so that adjacent numbers have a single digit differing by 1.

    
Gray codes of length 4:
In[8]:=
Click for copyable input
Out[8]=
In[9]:=
Click for copyable input
Out[9]//BaseForm=
New to Mathematica? Find your learning path »
Have a question? Ask support »