The city-building sequence is the integer sequence obtained by placing buildings at consecutive integer positions along a straight street, choosing each height to be the smallest nonnegative integer equal to the number of earlier rooftops visible from its top. A rooftop is visible when every intervening rooftop lies on or below the line segment joining it to the new rooftop. In particular, collinear rooftops count separately. The visibility rule suggests the descriptive name rooftop visibility sequence. The first building has height 0, and the first terms are 0, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 10, ... (OEIS A400000).
The animation above shows the construction of the first 16 buildings. The candidate building is orange, visible earlier rooftops are blue, and hidden rooftops are gray.
Dashed sight lines connect the candidate rooftop to each visible rooftop. Each trial
is labeled with its height , visible-rooftop count, and whether it is rejected (red) or
chosen (green). The comparison of the count with
uses the same status color.
The static panels show completed skylines for the first 16, 32, 64, and 128 buildings.
The sequence continues indefinitely, is unbounded, and contains every nonnegative integer (OEIS A400000). To see why a next term always exists,
let
be the visible-rooftop count from a candidate height
. This count is nondecreasing
as
increases. After at least one building has been placed,
, while
for sufficiently large
. The least integer
with
therefore satisfies
.
For ,
1, 2, ..., let
be the position of the first building of height
. The first terms of this sequence
are 1, 2, 4, 8, 24, 128, 648, 1351, 1278, 136, 16, 48, ... (OEIS A399763).
On Oct. 27, 2026, Sponaugle (2026) reported that all heights from 0 through
380 had occurred in the first
terms, but 381 had not. Thus 381 was the smallest height
whose first occurrence remained unlocated in that computation, with
.
It is conjectured that the limit superior of the running arithmetic mean is at most 3 (OEIS A400000),
The sequence won the OEIS 400K celebration contest (OEIS Foundation Inc. 2026a). It was also featured in the front-page banner of the On-Line Encyclopedia of Integer Sequences, reproduced above as it appeared on Oct. 25, 2026 (OEIS Foundation Inc. 2026b).

