TOPICS
Search

Hamming Number


A Hamming number is a positive integer of the form

 2^a3^b5^c,

where a, b, and c are nonnegative integers. Equivalently, the Hamming numbers are the 5-smooth numbers. They begin

 1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,...

(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).


See also

Prime Factorization, Smooth Number

Explore with Wolfram|Alpha

References

Dijkstra, E. W. "An Exercise Attributed to R. W. Hamming." Ch. 17 in A Discipline of Programming. Englewood Cliffs, NJ: Prentice-Hall, pp. 129-134, 1976.Dijkstra, E. W. "Hamming's Exercise in SASL." EWD792, 1981. https://www.cs.utexas.edu/~EWD/ewd07xx/EWD792.PDF.Sloane, N. J. A. Sequence A051037 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Hamming Number." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/HammingNumber.html

Subject classifications