login
Variation on the Inventory Sequence A342585: the same rules as A342585 are used except that the terms count the occurrences of the iterating number, treated as a string, in the string concatenation of all previous terms. See the Comments.
1

%I #16 Nov 24 2021 01:25:08

%S 0,1,1,0,2,2,2,0,3,2,4,1,1,0,4,4,4,1,4,0,5,5,4,1,6,2,1,0,6,7,5,1,6,3,

%T 3,1,0,7,9,5,3,6,4,4,2,0,8,9,6,4,9,4,5,2,1,3,4,2,0,9,10,8,5,11,6,6,2,

%U 2,4,5,3,0,11,15,10,6,12,8,8,2,4,4,6,5,1,1,1,1,3,0,13,23,13,10,14

%N Variation on the Inventory Sequence A342585: the same rules as A342585 are used except that the terms count the occurrences of the iterating number, treated as a string, in the string concatenation of all previous terms. See the Comments.

%C This is a variation of A342585. The same rules apply except that each number, as it iterates from counting zeros to counting the next number until zero occurrences are found, is treated as a string. The number of occurrences of this string is counted in the concatenation of all previous terms which is also treated as a string. For example when the sequence is adding the number of occurrences of 10, this is treated as the string '10', and thus any occurrence of '10' in the concatenation of all previous terms is counted. This would therefore count the term 1 followed by 0 as an occurrence of '10'. The strings are allowed to overlap, e.g., the number '111' would increment the count of 1's three times, the count of 11's two times, and the count of 111's one time.

%C Counting the occurrences of each number treated as a string leads to many more terms being found before a zero term is recorded. For example the iteration spanning the 5 millionth term has a(4989084) = 0, a(4989085) = 1059723, then a(5019089) = 2, a(5019090) = 0. Therefore at this stage every number, treated as a string, from 0 to 30005 has occurred at least once in the concatenation of all previous terms.

%C Unlike A342585 the number of occurrences of the smaller values does not seem to change order as n gets larger. After 5 million terms the order of most frequent occurrences is 1,2,3,4,5,6,7,8,9,0,11,12,10,21,13,14,15,16. It is unlikely the single-digit order changes although, considering that 21 appears high on the count for 2-digit numbers, the order of these and other 2-digit values may change as n gets larger. See the linked image.

%H Scott R. Shannon, <a href="/A348288/a348288_1.png">Image of the first 5 million terms</a>.

%e a(56) = 4. This is the first term that differs from A342585 as in that sequence no 10's have occurred after 55 terms. However in this sequence '10' can be formed by '1' followed by '0', and in the concatenation of terms a(0) to a(55) that has occurred four times, starting as a(2), a(12), a(26), a(35).

%o (Python)

%o def count_overlaps(subs, s):

%o c = i = 0

%o while i != -1:

%o i = s.find(subs, i)

%o if i != -1: c += 1; i += 1

%o return c

%o def aupton(terms):

%o alst, astr, numtocount = [0], "0", 0

%o for n in range(2, terms+1):

%o c = count_overlaps(str(numtocount), astr)

%o numtocount = 0 if c == 0 else numtocount + 1

%o alst.append(c)

%o astr += str(c)

%o return alst

%o print(aupton(95)) # _Michael S. Branicky_, Oct 10 2021

%Y Cf. A342585, A347738, A345730, A032531, A181391.

%K nonn,base

%O 0,5

%A _Scott R. Shannon_, Oct 10 2021