cp's OEIS Frontend

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.

A348288 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.

This page as a plain text file.
%I A348288 #16 Nov 24 2021 01:25:08
%S A348288 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 A348288 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 A348288 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 A348288 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 A348288 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 A348288 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 A348288 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 A348288 Scott R. Shannon, <a href="/A348288/a348288_1.png">Image of the first 5 million terms</a>.
%e A348288 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 A348288 (Python)
%o A348288 def count_overlaps(subs, s):
%o A348288     c = i = 0
%o A348288     while i != -1:
%o A348288         i = s.find(subs, i)
%o A348288         if i != -1: c += 1; i += 1
%o A348288     return c
%o A348288 def aupton(terms):
%o A348288     alst, astr, numtocount = [0], "0", 0
%o A348288     for n in range(2, terms+1):
%o A348288         c = count_overlaps(str(numtocount), astr)
%o A348288         numtocount = 0 if c == 0 else numtocount + 1
%o A348288         alst.append(c)
%o A348288         astr += str(c)
%o A348288     return alst
%o A348288 print(aupton(95)) # _Michael S. Branicky_, Oct 10 2021
%Y A348288 Cf. A342585, A347738, A345730, A032531, A181391.
%K A348288 nonn,base
%O A348288 0,5
%A A348288 _Scott R. Shannon_, Oct 10 2021