OFFSET
1,2
COMMENTS
Consider a stack of numbers where the number in layer k is stable if the numbers above it sum to the same or a lesser value than the number. If the numbers above it sum to a greater value then the stack collapses at that layer - it is stabilized by layer k+1 combining with layer k so that the number in layer k+1 is added to that in layer k, and layer k+1 is removed. If after adding a number to the top of the stack multiple collapses will occur then the stabilization process occurs from the topmost unstable layer first and then proceeds down the stack. Given these rules, start with an empty stack and proceed to add each number n to the top of the stack; the sequence gives the number in layer k after n is added.
On adding numbers up to 5000000000 the stack only has a height of 1 on five occasions, for n = 1, 2, 4, 6, 12; it is likely no more complete collapses occur but this is unknown. Likewise it has a height of 2 on thirty occasions, the last time being for n = 520. The maximum stack height in this range is 27, reached on adding 3396002887. In this same range on only two occasions does a number equal the sum of the numbers above it; on adding 3 and 63; see the examples below. It is unknown if this occurs again.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10005
Scott R. Shannon, Unflattened table up to n = 10000.
EXAMPLE
a(2,1) = 3. On adding 2 on top of 1 the stack is unstable, so 2 is added to 1 leaving 3 in layer one.
a(3,1) = 3, a(3,2) = 3. As 3 can support numbers above it which sum to the same value, the stack is stable. This is the first occurrence where a number supports exactly its own value.
a(4,1) = 10. When 4 is added to the top of the 3,3 stack, it is unstable and the 3 in layer two combines with the 4 in layer three to leave 3,7. This is now also unstable to the 3 and 7 combine to leave 10 in layer one.
On adding 63 the stack is 1176, 420, 234, 123, 63. Note the 420 = 234 + 123 + 63. This is the second and last know occurrence where a number supports exactly its own value.
The table begins:
1;
3;
3, 3;
10;
10, 5;
21;
21, 7;
21, 15;
36, 9;
36, 19;
36, 19, 11;
78;
78, 13;
78, 27;
78, 27, 15;
78, 58;
78, 58, 17;
136, 35;
136, 35, 19;
136, 74;
136, 74, 21;
.
.
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Scott R. Shannon, Feb 11 2024
STATUS
approved