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.
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, 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, 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
Offset: 0
Examples
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).
Links
- Scott R. Shannon, Image of the first 5 million terms.
Programs
-
Python
def count_overlaps(subs, s): c = i = 0 while i != -1: i = s.find(subs, i) if i != -1: c += 1; i += 1 return c def aupton(terms): alst, astr, numtocount = [0], "0", 0 for n in range(2, terms+1): c = count_overlaps(str(numtocount), astr) numtocount = 0 if c == 0 else numtocount + 1 alst.append(c) astr += str(c) return alst print(aupton(95)) # Michael S. Branicky, Oct 10 2021
Comments