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:
  • Gray Code (Wolfram MathWorld)