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 A348016 #20 May 07 2023 09:59:07 %S A348016 0,1,0,3,1,0,5,2,0,6,3,0,7,5,0,8,6,0,9,6,1,4,0,11,7,2,4,0,12,9,4,4,0, %T A348016 13,10,6,6,0,14,10,6,10,0,15,10,6,14,0,16,10,6,17,1,1,0,19,12,6,18,1, %U A348016 3,0,21,13,6,20,1,4,0,23,15,7,21,1,4,0,25,16,9,22,2,4,0,26,17 %N A348016 Record the number of terms with no proper divisors, then the number with one proper divisor, then two, three, etc., until reaching a zero term. After each zero term, repeat the count as before. %C A348016 An inventory sequence counting the proper divisors of existing terms, where zero is taken to have no proper divisors (see A032741). After every occurrence of a zero term the incremental count of terms with 0,1,2,... proper divisors is repeated until another zero term is encountered. %H A348016 David A. Corneth, <a href="/A348016/b348016.txt">Table of n, a(n) for n = 0..9999</a> %e A348016 a(0) = 0 because at first there are no terms, therefore there are no terms with no proper divisors. %e A348016 a(1) = 1 because now there is one term (a(0)) which has no proper divisors. %e A348016 a(2) = 0 since there are no terms with one proper divisor. %e A348016 a(3) = 3 since there are now three terms having just one proper divisor (0,1,0). %e A348016 As an irregular triangle the sequence begins: %e A348016 0, 1, 0; %e A348016 3, 1, 0; %e A348016 5, 2, 0; %e A348016 6, 3, 0; %e A348016 7, 5, 0; %e A348016 8, 6, 0; %e A348016 9, 6, 4, 1, 0; %e A348016 11, 7, 2, 4, 0; %e A348016 etc. %o A348016 (PARI) first(n) = { t = 0; res = vector(n); l = List([1]); for(i = 2, n, for(i = #l + 1, t+1, listput(l, 0) ); res[i] = l[t + 1]; q = if(l[t + 1] == 0, 0, numdiv(l[t + 1]) - 1); for(i = #l + 1, q + 1, listput(l, 0) ); l[q + 1]++; if(res[i] == 0, t = 0 , t++ ) ); res } \\ _David A. Corneth_, Sep 25 2021 %o A348016 (Python) %o A348016 from sympy import divisor_count %o A348016 from collections import Counter %o A348016 def f(n): return 0 if n == 0 else divisor_count(n) - 1 %o A348016 def aupton(nn): %o A348016 num, alst, inventory = 0, [0], Counter([0]) %o A348016 for n in range(1, nn+1): %o A348016 c = inventory[num] %o A348016 num = 0 if c == 0 else num + 1 %o A348016 alst.append(c) %o A348016 inventory.update([f(c)]) %o A348016 return alst %o A348016 print(aupton(84)) # _Michael S. Branicky_, May 07 2023 %Y A348016 Cf. A032741, A342585, A345730, A347791. %K A348016 nonn,tabf %O A348016 0,4 %A A348016 _David James Sycamore_, Sep 24 2021 %E A348016 Data corrected and extended by _David A. Corneth_, Sep 25 2021