login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A361287
A variant of the inventory sequence A342585: now a row ends when the number of occurrences of the largest term in the sequence thus far has been recorded.
1
0, 1, 1, 1, 3, 0, 1, 2, 4, 1, 1, 1, 2, 7, 2, 1, 1, 0, 0, 1, 4, 10, 3, 2, 2, 0, 0, 1, 0, 0, 1, 8, 12, 5, 2, 2, 1, 0, 1, 1, 0, 1, 0, 1, 11, 17, 7, 2, 2, 1, 0, 2, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 17, 23, 10, 2, 2, 1, 0, 2, 1, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0
OFFSET
0,5
LINKS
FORMULA
a(n) is the number of all a(k) == b(n) 0 <= k < n and b(0) = 0 and b(n) = b(n-1)+1 if an a(k) > b(n) exists for 0 <= k < n, and 0 otherwise.
EXAMPLE
The triangle begins:
0;
1, 1;
1, 3, 0, 1;
2, 4, 1, 1, 1;
2, 7, 2, 1, 1, 0, 0, 1;
4, 10, 3, 2, 2, 0, 0, 1, 0, 0, 1;
8, 12, 5, 2, 2, 1, 0, 1, 1, 0, 1, 0, 1;
11, 17, 7, 2, 2, 1, 0, 2, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1;
17, 23, 10, 2, 2, 1, 0, 2, 1, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1;
...
a(0)=0 because we begin each row by recording the number of zeros in the sequence. As yet, there are none. 0 is still the largest term in the sequence, so we begin the next row.
a(1)=1 because there is one 0. a(2)=1 because there is one 1. 1 is the largest term thus far, so we begin the next row.
a(3)=1 (there is still one zero); a(4)=3 (there are three 1s); a(5)=0 (no 2s); the row ends with a(6)=1 because there is one 3 and three is the largest term thus far.
MATHEMATICA
len = 84; K = {0}; While[Length@K <= len, i = 0; While[i <= Max@K, AppendTo[K, Count[K, i]]; i++]]; Print[Take[K, len + 1]] (* Samuel Harkness, Mar 12 2023 *)
PROG
(Python)
from collections import Counter
from itertools import count, islice
def agen(): # generator of terms
an, b, m, inventory = 0, 0, 0, Counter([0])
for n in count(1):
yield an
an = inventory[b]
m = max(m, an)
b = b + 1 if m > b else 0; inventory.update([an])
print(list(islice(agen(), 85))) # Michael S. Branicky, Mar 07 2023
CROSSREFS
Sequence in context: A049765 A343394 A194801 * A273901 A014573 A067166
KEYWORD
nonn,tabf
AUTHOR
Robert Dober, Mar 07 2023
EXTENSIONS
More terms from Alois P. Heinz, Mar 07 2023
STATUS
approved