A383967 Inventory sequence recording number of terms with 1,2,3,... decimal digits. Count until occurrence of a term = 0, whereupon reset the count; continue.
0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 1, 0, 13, 2, 0, 15, 3, 0, 17, 4, 0, 19, 5, 0, 21, 6, 0, 23, 7, 0, 25, 8, 0, 27, 9, 0, 29, 10, 0, 30, 12, 0, 31, 14, 0, 32, 16, 0, 33, 18, 0, 34, 20, 0, 35, 22, 0, 36, 24, 0, 37, 26, 0, 38, 28, 0, 39, 30, 0, 40, 32, 0, 41, 34
Offset: 1
Examples
a(1) = 0 because at first there are no terms with just one decimal digit. Following a zero term the count is reset and now since there is one term (a(1) = 0) with just one digit, a(2) = 1. Since there are no terms with two digits a(3) = 0. The count resets again and a(4) = 3 because there are now three terms (0,1,0) which have only one digit. Since there are no terms with two digits a(5) = 0. The sequence continues 0,1,0,3,0,5,0,7,0,9,0 and at this point we have 11 terms with one digit then one term (11) with two digits, so the next two terms are 11,1 followed by 0 since there is not yet a term with three digits; and so on.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20, showing a(n) = 0 instead as 1/2 for visibility.
Programs
-
Mathematica
nn = 120; q[] := 0; f[x] := If[x == 0, 1, IntegerLength[x]]; j = 0; c = 1; q[1]++; {j}~Join~Reap[Do[If[j == 0, c = 1]; j = Sow[q[c]]; c++; q[f[j]]++, nn - 1] ][[-1, 1]] (* Michael De Vlieger, Jun 01 2025 *)