A Hamming number is a positive integer of the form
where ,
, and
are nonnegative integers.
Equivalently, the Hamming numbers are the 5-smooth numbers.
They begin
(OEIS A051037). The name refers to a problem attributed to R. W. Hamming of generating these numbers in increasing order without duplicates (Dijkstra 1976, pp. 129-134).
The sequence can be generated in increasing order without duplicates by starting with 1 and merging three copies of it scaled by 2, 3, and 5, retaining equal values only once. Dijkstra (1981) describes the corresponding construction for powers of 2 and 3.