The three-digit numbers 000 through 999 (base 10) can be arranged in a circular list so that consecutive numbers differ in exactly one digit.

In this chapter, we describe some basic counting algorithms, including Gray codes. Gray codes are a popular topic in computer science because of their connections with algorithms, graphs, and puzzles like the Tower of Hanoi.