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.
%I A355917 #20 Sep 25 2022 21:35:31 %S A355917 0,2,0,4,1,1,0,6,4,2,1,2,0,8,6,5,2,3,2,2,0,10,7,9,4,5,4,3,2,1,1,1,0, %T A355917 12,11,11,6,7,5,5,4,2,2,2,3,1,0,14,13,15,8,9,8,6,5,5,4,3,4,2,2,1,1,0, %U A355917 16,16,18,10,12,11,8,6,7,5,5,6,4,3,2,2,3,0 %N A355917 Variant of Inventory Sequence A342585 where indices are also counted (short version). %C A355917 See A355916 for further information. %H A355917 Rémy Sigrist, <a href="/A355917/b355917.txt">Table of n, a(n) for n = 1..10030</a> %H A355917 Rémy Sigrist, <a href="/A355917/a355917.gp.txt">PARI program</a> %e A355917 The first eight inventories are: %e A355917 0, %e A355917 2, 0, %e A355917 4, 1, 1, 0, %e A355917 6, 4, 2, 1, 2, 0, %e A355917 8, 6, 5, 2, 3, 2, 2, 0, %e A355917 10, 7, 9, 4, 5, 4, 3, 2, 1, 1, 1, 0, %e A355917 12, 11, 11, 6, 7, 5, 5, 4, 2, 2, 2, 3, 1, 0, %e A355917 14, 13, 15, 8, 9, 8, 6, 5, 5, 4, 3, 4, 2, 2, 1, 1, 0, %e A355917 ... %t A355917 nn = 9; c[_] = 0; i = 1; Do[k = 0; While[c[k] > 0, Set[{a[i], a[i + 1]}, {c[k], k}]; c[a[i]]++; c[a[i + 1]]++; i += 2; k++]; Set[{a[i], a[i + 1]}, {c[k], k}]; c[a[i]]++; c[a[i + 1]]++; i += 2, nn]; Array[a[2 # - 1] &, (i - 1)/2] (* _Michael De Vlieger_, Sep 25 2022 *) %o A355917 (PARI) See Links section. %o A355917 (Python) %o A355917 from collections import Counter %o A355917 def aupton(terms): %o A355917 num, alst, inventory = 0, [0, 0], Counter([0, 0]) %o A355917 for n in range(3, 2*terms): %o A355917 c = [inventory[num], num] %o A355917 num = 0 if c[0] == 0 else num + 1 %o A355917 alst.extend(c) %o A355917 inventory.update(c) %o A355917 return alst[:2*terms:2] %o A355917 print(aupton(82)) # _Michael S. Branicky_, Sep 25 2022 %Y A355917 Cf. A342585, A355916, A355918. %K A355917 nonn %O A355917 1,2 %A A355917 _N. J. A. Sloane_, Sep 24 2022 %E A355917 More terms from _Rémy Sigrist_, Sep 25 2022