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.

A347738 A variant of the inventory sequence: record the number of terms >= 0 thus far in the sequence, then the number of terms >= 1 thus far, then the number of terms >= 2 thus far, and so on, until a zero is recorded; the inventory then starts again, recording the number of terms >= 0, etc.

This page as a plain text file.
%I A347738 #49 Sep 19 2021 13:03:21
%S A347738 0,1,1,0,4,3,2,2,1,0,10,8,6,5,5,5,3,2,2,1,1,0,22,19,15,12,11,11,9,9,
%T A347738 10,10,9,6,4,3,3,3,2,2,2,2,1,1,1,0,46,42,35,28,24,23,21,20,21,21,19,
%U A347738 17,16,16,17,18,18,17,15,13,11,10,7,6,5,4,4,4,4,3,3
%N A347738 A variant of the inventory sequence: record the number of terms >= 0 thus far in the sequence, then the number of terms >= 1 thus far, then the number of terms >= 2 thus far, and so on, until a zero is recorded; the inventory then starts again, recording the number of terms >= 0, etc.
%C A347738 Sequence starts off as A342585 but diverges after a(4). The effect is to introduce some numbers earlier in this sequence than in the original, and to stretch out the incidences of zero terms by the fact that the term immediately following a zero is now the total number of prior terms, rather than the total number of prior zero terms.
%C A347738 In A342585 zeros occur at positions 1,4,8,14,20,28,... (see A343880) whereas in this version they occur at positions 1,4,10,22,46,... (which is A033484, as is easily proved by induction).
%H A347738 Michael De Vlieger, <a href="/A347738/b347738.txt">Table of n, a(n) for n = 0..24573</a> (rows 0 <= k <= 12 when considered as an irregular triangle)
%H A347738 Michael De Vlieger, <a href="/A347738/a347738.png">log-log scatterplot of a(n)</a> for 1 <= n <= 49150 (ignoring zeros).
%e A347738 As an irregular triangle this begins:
%e A347738    0;
%e A347738    1,  1,  0;
%e A347738    4,  3,  2,  2,  1,  0;
%e A347738   10,  8,  6,  5,  5,  5, 3, 2,  2,  1, 1, 0;
%e A347738   22, 19, 15, 12, 11, 11, 9, 9, 10, 10, 9, 6, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 0;
%e A347738   46, ...
%e A347738 (for row lengths see A003945)
%t A347738 a[n_] := a[n] = Block[{t}, t = If[a[n - 1] == 0, 0, b[n - 1] + 1]; b[n] = t; Sum[If[a[j] >= t, 1, 0], {j, n - 1}]]; b[1] = a[1] = 0; Array[a, 77] (* _Michael De Vlieger_, Sep 12 2021, after _Jean-François Alcover_ at A342585 *)
%o A347738 (Python)
%o A347738 def aupton(nn):
%o A347738     num, gte_inventory, alst, bigc = 0, [1], [0], 0
%o A347738     while len(alst) < nn+1:
%o A347738         c = gte_inventory[num] if num <= bigc else 0
%o A347738         num = 0 if c == 0 else num + 1
%o A347738         for i in range(min(c, bigc)+1):
%o A347738             gte_inventory[i] += 1
%o A347738         for i in range(bigc+1, c+1):
%o A347738             gte_inventory.append(1)
%o A347738         bigc = len(gte_inventory) - 1
%o A347738         alst.append(c)
%o A347738     return alst
%o A347738 print(aupton(76)) # _Michael S. Branicky_, Sep 19 2021
%Y A347738 Cf: A342585, A033484, A003945, A343880, A003945 (row lengths), A347324 (row sums).
%Y A347738 A347326 has a version of this in which the rows have been normalized.
%K A347738 nonn,tabf,nice,look
%O A347738 0,5
%A A347738 _David James Sycamore_, Sep 12 2021
%E A347738 Offset changed to 0 by _N. J. A. Sloane_, Sep 12 2021