p.enthalabs

A400000 - OEIS

A building a(j) "sees" an earlier building a(i) if every intermediate building a(k), i < k < j, has its top (k, a(k)) on or below the straight line joining (i, a(i)) and (j, a(j)).

If at some point there doesn't exist a next height h at which the condition is satisfied, the sequence is finite. The sequence has at least 2.3 billion terms.

If the sequence is infinite, does every number eventually appear? The earliest appearance of height h is [A399763](https://oeis.org/A399763 "a(n) = index of first appearance of a building of height n in the city-building sequence A400000.")(h). For record heights and when they appear, see [A399949](https://oeis.org/A399949 "Record high points in A400000.") and [A399950](https://oeis.org/A399950 "Indices of record high points in A400000.").

The apparent "spikes" at n = 16k for k = 1..7 (10, 10, 11, 10, 11, 10, 19) follow a pattern similar to the values at n for n = 2..8 (1, 1, 2, 1, 2, 1, 3). Similar temporary analogies seem to emerge at various scales, but do any last indefinitely?

The sequence is infinite: suppose that we have n > 0 terms:

- let v(k) be the number of buildings, among the first n buildings, visible from a building of height k >= 0 at position n+1,

- v(0) > 0 as we see the building at position n from the ground,

- v(k) = n for k sufficiently large as we see all the buildings from a point high enough,

- v(k) <= k for k sufficiently large,

- let h be the least k such that v(k) <= k (note that h > 0 as v(0) > 0),

- v(h-1) > h-1 by necessity; equivalently v(h-1) >= h,

- as v is weakly increasing, v(h) >= v(h-1) >= h,

- so v(h) = h, and a(n+1) = h.

The sequence b(n) = n-1 corresponds to the variant with the highest buildings.

The sequence is unbounded: by contradiction:

- boundedness implies a finite number of values,

- as the sequence is infinite, at least one value appears infinitely many times,

- let m be the greatest such value,

- a(n) <= m for n sufficiently large, say for n > s,

- the (m+2)-th occurrence of m beyond s sees the m+1 prior m's: a contradiction.

The k terms following a record high point, say a(n) >= k*(k-1), are independent of n: a(n+i) = a(i) + 1 for i = 1..k.

The sequence contains every integer: a(1) = 0; if v is a term, then v+1 is also a term.

Thanks to Ivan N. Ianakiev for our discussions, which led to these comments.

(End)

a(n) is the backward degree of node n in the natural visibility graph of the sequence itself (Lacasa et al., 2008), with collinear points counted as visible: each new term is the least value equal to the number of earlier terms it is connected to. Consequently, Sum_{k=1..n} a(k) is the number of edges of the natural visibility graph of the first n terms, and the conjecture in the Formula section is equivalent to the asymptotic mean degree of this graph being at most 6. - Francisco J. Muñoz, Oct 26 2026

Note that the above observation does not immediately extend to the asymptotic mean of the degrees of the first n nodes in the corresponding infinite graph. (Consider that the mean number of "forward" edges from nodes might be significantly greater than the mean number of "backward" edges.) - Peter Munn, Oct 28 2026

Before 1.48*10^11 no term exceeded 1998; afterwards there are 412 terms. The distribution of heights is very stable: in the first 1.046*10^13 terms the frequencies of 1, 2, 3, 4, 5 are 31.13%, 32.76%, 15.68%, 9.31%, 4.28%. The tallest building seen in the first 10^14 terms is 309063 at a(4961932825110). - Jeff Sponaugle, Oct 27 2026