A plot of the Ulam numbers up to 1082, arranged line by line in a
square 108×108. The plot evidentiates the peaks
in their density that occur with a frequency roughly equal
The Ulam sequence
is defined by
is the smallest integer that can be written in exactly one way as
The members of the Ulam sequence are called Ulam numbers.
For example, after the first 4 terms which are trivially 1, 2, 3 and 4, the value of cannot be 5, since but it is 6, which can be obtained only as (not as because the terms added must be distinct).
The sequence is infinite because is always a viable candidate for .
Ulam numbers are not distributed uniformly, but their
density has peaks at an average distance of 21.6 (see picture above).
The first Ulam numbers are
1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, 36, 38, 47, 48, 53, 57, 62, 69, 72, 77, 82, 87, 97, 99, 102 more terms
Below, the spiral pattern of Ulam numbers up to . See the page on prime numbers for an explanation and links to similar pictures.
Pictorial representation of remainders (mod 2, 3, ...,11) frequency. For a table of values and more details click here
A graph displaying how many Ulam numbers are multiples of the primes p
from 2 to 71. In black the ideal line 1/p