A368509 Irregular triangle read by rows. A variation on the inventory sequence A342585. See Comments and Example sections for details.
0, 1, 1, 1, 2, 2, 1, 2, 0, 0, 2, 3, 2, 3, 2, 5, 1, 2, 0, 0, 3, 5, 3, 4, 2, 6, 2, 4, 1, 2, 2, 2, 1, 1, 0, 0, 4, 7, 4, 7, 3, 10, 3, 6, 2, 4, 2, 2, 2, 2, 1, 2, 0, 0, 5, 9, 5, 8, 4, 14, 3, 6, 3, 6, 3, 4, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 6, 11, 6, 14, 5, 14, 4, 10, 4, 9, 4, 5
Offset: 1
Examples
The irregular triangle begins: 0, 1; 1, 1, 2, 2, 1, 2, 0, 0; 2, 3, 2, 3, 2, 5, 1, 2, 0, 0; 3, 5, 3, 4, 2, 6, 2, 4, 1, 2, 2, 2, 1, 1, 0, 0; 4, 7, 4, 7, 3, 10, 3, 6, 2, 4, 2, 2, 2, 2, 1, 2, 0, 0; ...
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A342585.
Programs
-
Python
from itertools import islice from collections import Counter def agen(): # generator of terms rowinventory, colinventory, thisrow, m = Counter(), dict(), set(), 0 while True: rc = rowinventory[m] yield rc if rc not in thisrow: rowinventory[rc] += 1; thisrow.add(rc) if rc not in colinventory: colinventory[rc] = {2*m} else: colinventory[rc].add(2*m) cc = len(colinventory.get(m, set())) yield cc if cc not in thisrow: rowinventory[cc] += 1; thisrow.add(cc) if cc not in colinventory: colinventory[cc] = {2*m+1} else: colinventory[cc].add(2*m+1) if rc == 0 or cc == 0: m = 0; thisrow = set() else: m += 1 print(list(islice(agen(), 90))) # Michael S. Branicky, Dec 28 2023
Comments