OFFSET
1,5
COMMENTS
Build an irregular triangle in a slightly similar manner to A342585:
Here, record the number of rows containing zeros thus far in the irregular triangle, then the number of columns containing zeros thus far, then the number of rows containing ones thus far, then again the number of columns with ones and so on alternately counts of rows and of columns, until a completed row-column value pair is recorded with either being zero; a new row of the triangle then starts again, recording the number of rows having any zero in them, then the number of columns, and so on. The sequence is the triangle read by rows.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
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;
...
PROG
(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
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Tamas Sandor Nagy, Dec 28 2023
STATUS
approved