A348328 Records inventory sequence: Record the number of record terms seen thus far, then the number of zero terms, then number of 1's, then 2's, etc until recording another zero term, at which point the count is repeated, as above.
0, 1, 1, 2, 1, 0, 3, 2, 3, 2, 2, 0, 4, 3, 3, 4, 4, 3, 0, 5, 4, 3, 4, 6, 5, 2, 1, 0, 7, 5, 4, 5, 6, 6, 4, 3, 1, 0, 8, 6, 5, 5, 7, 7, 6, 5, 3, 1, 0, 9, 7, 6, 5, 8, 7, 8, 6, 5, 3, 1, 0, 10, 8, 7, 5, 9, 7, 10, 7, 8, 5, 2, 2, 0, 11, 9, 7, 7, 9, 7, 11, 7, 12, 5, 4, 2, 2, 1, 0, 13, 10, 8, 9, 9, 8, 12, 7, 13, 7, 6, 3, 2, 2, 2, 0, 14, 11, 8, 12, 10, 8, 12, 8, 14, 10, 6, 5, 3, 4, 2, 2, 0
Offset: 0
Examples
a(0) = 0 because so far no terms have been seen, hence no records. Following zero term a(0) we reset the count and a(1) = 1 since a(0) = 0 is a record term. a(2) = 1, the number of 0's seen thus far, a(3) = 2, the number of 1's, a(4) = 1 the number of 2's, a(5) = 0 because no 3's have been seen thus far. Following a(5) = 0, we reset the count and record a(6) = 3, the number of record terms (0,1,2) seen thus far. a(7) = 2 since at this point the 2 zero terms have been counted; etc. As an irregular table the sequence starts: 0; 1, 1, 2, 1, 0; 3, 2, 3, 2, 2, 0; 4, 3, 3, 4, 4, 3, 0; 5, 4, 3, 4, 6, 5, 2, 1, 0; 7, 5, 4, 5, 6, 6, 4, 3, 1, 0; 8, 6, 5, 5, 7, 7, 6, 5, 3, 1, 0; ...
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10878 (rows n = 0..125, flattened.)
- Michael De Vlieger, Scatterplot of a(n) for n = 0..43057 (2^8 cycles), accentuating the trajectory of the records counter in red.
- Michael De Vlieger, Scatterplot of a(n) for n = 0..777315 (2^10 cycles), accentuating the trajectory of the records counter in red.
- Michael De Vlieger, Scatterplot of a(n) for n = 0..15009105 (2^12 cycles), accentuating the trajectory of the records counter in red.
- Michael De Vlieger, Scatterplot detail of a(n) < 1152 for n = 0..43057 (2^8 cycles), enlarging the dense part of the scatterplot.
- Michael De Vlieger, Scatterplot of a(n) for n = 0..43057 accentuating trajectories of the number of records in black, of 0's in red, 1's in orange, 2's in yellow, 3's in green, 4's in cyan, 5's in blue, and 6's in purple.
- Index entries for sequences related to the inventory sequence
Programs
-
Mathematica
Block[{c, k, m, r = 0}, c[-1] = 1; c[0] = 1; {0}~Join~Reap[Do[k = -1; While[IntegerQ[c[k]], Set[m, c[k]]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; If[m > r, Set[r, m]; c[-1]++]; k++]; Sow[0]; c[0]++, 11]][[-1, -1]]] (* Michael De Vlieger, Oct 14 2021 *)
Comments