%I #18 Apr 27 2022 17:32:36
%S 0,1,0,3,1,0,5,2,0,6,3,1,0,8,4,2,1,0,10,5,3,1,0,12,7,3,2,0,13,11,3,2,
%T 0,14,14,5,2,0,15,16,6,2,1,0,17,18,7,3,1,0,19,21,8,4,1,0,21,21,11,4,1,
%U 0,23,23,12,5,1,0,25,25,14,5,1,0,27,26,16,6,2
%N Inventory sequence counting prime factors. (See comment.)
%C 0 and 1 are the only nonnegative integers which have no prime factors. The sequence uses this property as follows: Record the number of existing terms which have 0 prime factors, then the number having 1 prime factor, then 2, 3 and so on until reaching a number k such that there are no terms having k prime factors (counted with multiplicity). At this point record a 0 term, and restart the count.
%H Michael De Vlieger, <a href="/A353092/b353092.txt">Table of n, a(n) for n = 0..11196</a> (as an irregular table, rows m = 0..2^10, flattened)
%H Michael De Vlieger, <a href="/A353092/a353092.png">Scatterplot of a(n)</a>, n = 1..11185 (2^10 zeros), with a color code assigning black to 0, and color-coding trajectories, starting with red and ending with magenta, pertaining to omega(k), 1 <= k <= 15 respectively.
%H Michael De Vlieger, <a href="/A353092/a353092_1.png">Log-log scatterplot of a(n)</a>, n = 1..11185 (2^10 zeros), color-coding trajectories, starting with red and ending with magenta, pertaining to omega(k), 1 <= k <= 15 respectively.
%H <a href="/index/In#inventory">Index entries for sequences related to the inventory sequence</a>
%e a(0) = 0 since at first there are no terms, hence 0 terms with 0 prime factors. The count now restarts because a 0 term has occurred.
%e a(1) = 1 because now there is one term (a(0)) which has no prime factor.
%e a(2) = 0 because there is no term with one factor. The count now restarts.
%e a(3) = 3 because all three prior terms have no prime factor.
%e a(4) = 1 since a(3) is prime, the first to occur in the sequence.
%e a(5) = 0 since there are no terms with 2 prime divisors. The count now restarts...
%e As an irregular table the sequence starts:
%e 0;
%e 1, 0;
%e 3, 1, 0;
%e 5, 2, 0;
%e 6, 3, 1, 0;
%e 8, 4, 2, 1, 0;
%e 10, 5, 3, 1, 0;
%t a[1] = c[_] = 0; j = c[-1] = c[0] = 1; Do[k = 0; While[c[k] > 0, j++; Set[m, c[k]]; Set[a[j], m]; c[If[m < 2, 0, PrimeOmega[m]]]++; k++]; j++; Set[a[j], 0]; c[0]++, 16]; Array[a, j] (* _Michael De Vlieger_, Apr 23 2022 *)
%o (Python)
%o from sympy import factorint
%o from collections import Counter
%o def f(n): return 0 if n < 2 else sum(e for p, e in factorint(n).items())
%o def aupton(nn):
%o num, alst, inventory = 0, [0], Counter([0])
%o for n in range(1, nn+1):
%o c = inventory[num]
%o num = 0 if c == 0 else num + 1
%o alst.append(c)
%o inventory.update([f(c)])
%o return alst
%o print(aupton(78)) # _Michael S. Branicky_, Apr 22 2022
%Y Cf. A342585, A347791.
%K nonn
%O 0,4
%A _David James Sycamore_, Apr 22 2022
%E a(50) and beyond from _Michael S. Branicky_, Apr 22 2022