A359010 Variant of the inventory sequence: Record the number of terms whose value occurs once thus far in the sequence, then the number of terms whose value occurs twice thus far, and so on; a row ends when a 0 that would repeat infinitely is reached.
0, 1, 0, 1, 4, 0, 1, 0, 3, 4, 0, 1, 2, 0, 4, 0, 2, 2, 6, 4, 0, 2, 0, 0, 12, 0, 3, 2, 0, 8, 5, 0, 4, 2, 0, 4, 0, 12, 0, 3, 2, 3, 8, 0, 6, 7, 0, 2, 6, 3, 4, 5, 0, 7, 8, 0, 0, 6, 3, 8, 0, 6, 7, 8, 0, 0, 4, 3, 4, 10, 0, 7, 8, 9, 0, 2, 4, 0, 8, 5, 0, 14, 0, 9, 10, 0
Offset: 1
Examples
First few rows of irregular triangle: 0; 1, 0; 1, 4, 0; 1, 0, 3, 4, 0; 1, 2, 0, 4, 0; 2, 2, 6, 4, 0; 2, 0, 0, 12, 0; 3, 2, 0, 8, 5, 0; 4, 2, 0, 4, 0, 12, 0; 3, 2, 3, 8, 0, 6, 7, 0; 2, 6, 3, 4, 5, 0, 7, 8, 0;
Links
- Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10073 (first 136 rows)
Programs
-
Python
from collections import Counter from itertools import count, islice def end_cond(I, k): # the only value left occurring >= k times is 0 return I[0] >= k and not any(I[i] >= k for i in I if i > 0) def agen(): # generator of terms I = Counter() while True: for i in count(1): c = sum(v for v in I.values() if v==i) yield c I[c] += 1 if c == 0 and end_cond(I, i): break print(list(islice(agen(), 86))) # Michael S. Branicky, Jan 28 2025
Comments