OEIS A400000 · the first terms

The 100-Trillion City

Put up buildings one at a time along a street. Each new building gets the smallest height from which it can see exactly that many of the earlier buildings. These are the first hundred trillion buildings, computed in two and a half days on a Mac Studio.

The skyline

For its first 148 billion buildings the city never rose above 1,998 storeys. Then came a(147,875,405,265) = 296,961, and the city changed. Since then towers of 20,000+ storeys have gone up, of them above 100,000. Only three of those were records.

The tallest building in each block of 10·231 ≈ 21.5 billion terms, on a log scale. The lighter inner bar is the block's fifth-tallest. Hover a block for its five tallest buildings.

Every building, counted

Each column is one block of 85.9 billion terms; each row is a band of heights. The bands hardly change from left to right: over a hundred trillion terms of all buildings have height 1 and have height 2. Above about 2,000 the map turns into scattered points: the towers.

buildings per block and height band:1the five tallest of each 21.5-billion block, where 2,000 or taller

When each height first appeared

Every height from 0 to has been built; never has. OEIS listed first appearances up to height 55. The giants matter here too: within a few million terms of the first record giant, dozens of heights appeared for the first time, among them 58, 82, 83 and 89.

heights 0– (all built)taller heightsrecordsboth axes logarithmic

The echo

A comment by R. Sigrist in the OEIS entry says that the k terms following a record a(n) ≥ k(k−1) repeat the start of the sequence one storey taller: a(n+i) = a(i)+1 for i = 1..k. Applying that inequality to 296,961 gives k = 545, since 545·544 = 296,480 ≤ 296,961 < 546·545. The city actually repeats itself for 2,721 buildings, after all three record giants.

The k(k−1) form allows for the tallest early buildings possible. Redoing the argument with the actual heights of the early buildings proves an echo of at least 2,721 buildings for any record from 138,418 to 402,856 storeys. This proof is computer-assisted: it depends on the computed early terms.

At i = 2,722 the echo breaks once. The original city has a 148-storey building at position 2,721; its echo is 149 storeys, right next door to position 2,722. From there it hides the giant, so a(n+2,722) = 1 instead of 2. Any giant under about 402,000 storeys loses its echo at exactly this step. Then the echo picks up again.

Above the line: a(i)+1 for i = 1–3,000, the start of the city one storey taller. Below, reflected: a(147,875,405,265 + i), the 3,000 buildings after the first giant. The two halves mirror each other exactly except at the red mark, i = 2,722.

The same street

The record giants stand trillions of buildings apart, yet the buildings leading up to them are the same.

How tall buildings get

Counts fall steadily up to about 1,000 storeys and then drop off a cliff. Below 2,000 every height is built millions of times; above 2,000 almost every height is built once or not at all. The points out to the right are the towers from the skyline.

Number of buildings of each height among the first , both axes logarithmic.

The average building

Paolo Xausa conjectured that the running mean of the heights, S(n)/n with S(n) = a(1) + … + a(n) (A397740), has limsup at most 3. Over the first hundred trillion terms it never comes close. Checking every n up to 1.1·1011, the largest value is 2.935191, at n = 429,540,755. After that, the exact sums logged every 230 terms prove it stays below 2.9637, and at those points it never exceeds 2.9351552.

Since about 1011 the mean has been drifting down very slowly, and it now stands at . Even the giants barely register: adding 296,961 storeys at n = 1.48·1011 moved it by 2·10−6.

S(n)/n for n = 1 to , with n on a log scale. The dashed line is the conjectured bound, 3.
The same curve from n = 108, with the vertical scale magnified about 15,000 times. Red dot: the largest value. Dashed lines: the three record giants.

Explore it yourself

All hundred trillion terms are in a single compressed file of 16.5 GB, with a small command-line program that prints any stretch of the street: a single building, a b-file of a billion terms, the records, or where each height first appears. The program can also read the file straight from this web site, downloading only the few hundred kilobytes a question needs.