cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A359010 #37 May 10 2025 09:02:50
%S A359010 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,
%T A359010 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,
%U A359010 4,10,0,7,8,9,0,2,4,0,8,5,0,14,0,9,10,0
%N 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.
%C A359010 Note that we are counting terms with repetition. For example, to find a(5)=4, we are looking for the number of terms that appear twice. 0 and 1 each occur twice, which is 2+2=4 (not 1+1=2). This means that each column contains only multiples of the number of occurrences it is counting.
%C A359010 A row ends when a 0 is reached as the k-th term in a row and the only value left occurring greater than or equal to k times is 0. - _Neal Gersh Tolunsky_, Feb 08 2025
%H A359010 Neal Gersh Tolunsky, <a href="/A359010/b359010.txt">Table of n, a(n) for n = 1..10073</a> (first 136 rows)
%e A359010 First few rows of irregular triangle:
%e A359010   0;
%e A359010   1,  0;
%e A359010   1,  4,  0;
%e A359010   1,  0,  3,  4,  0;
%e A359010   1,  2,  0,  4,  0;
%e A359010   2,  2,  6,  4,  0;
%e A359010   2,  0,  0, 12,  0;
%e A359010   3,  2,  0,  8,  5,  0;
%e A359010   4,  2,  0,  4,  0, 12,  0;
%e A359010   3,  2,  3,  8,  0,  6,  7,  0;
%e A359010   2,  6,  3,  4,  5,  0,  7,  8,  0;
%o A359010 (Python)
%o A359010 from collections import Counter
%o A359010 from itertools import count, islice
%o A359010 def end_cond(I, k): # the only value left occurring >= k times is 0
%o A359010     return I[0] >= k and not any(I[i] >= k for i in I if i > 0)
%o A359010 def agen(): # generator of terms
%o A359010     I = Counter()
%o A359010     while True:
%o A359010         for i in count(1):
%o A359010             c = sum(v for v in I.values() if v==i)
%o A359010             yield c
%o A359010             I[c] += 1
%o A359010             if c == 0 and end_cond(I, i):
%o A359010                 break
%o A359010 print(list(islice(agen(), 86))) # _Michael S. Branicky_, Jan 28 2025
%Y A359010 Cf. A342585, A350768.
%K A359010 nonn,tabf
%O A359010 1,5
%A A359010 _Neal Gersh Tolunsky_, Dec 11 2022