The ascending sequence of positive integers divisible only by 2, 3, and 5. Writing a computer program to generate the sequence (in sorted order!) is nontrivial. While the problem used to be a poster child for the co-routines crowd, today it is often mentioned as an application of lazy evaluation.

The first 20 elements of the Hamming sequence are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36. This was computed by a (clearly-written!) 47-line functional Perl program.

Log in or register to write something here or to contact authors.