A273943 Put and say how often: a(n) = n/2 if n is even, else a(n) = number of matches of "a(n-1)" in the concatenation of all "a(i)" with i < n, where "x" denotes the decimal string of x.
0, 1, 1, 2, 2, 2, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 4, 12, 2, 13, 1, 14, 3, 15, 2, 16, 2, 17, 2, 18, 2, 19, 2, 20, 1, 21, 6, 22, 5, 23, 2, 24, 1, 25, 2, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 4, 32, 2, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 5, 42, 1, 43, 3, 44, 1, 45, 1, 46, 1, 47, 1, 48, 1, 49, 1, 50, 1, 51, 4, 52, 4, 53, 1, 54, 2
Offset: 0
Examples
a(4) = 2 by definition and a(5) = 2 because "2" appears twice in the string built from the first 5 entries, i.e. "01122". Nice question: how to continue 0112223141516171819110111? Answer: 4, since 11 was put last and there are 4 occurrences of 11 so far.
Links
- Rainer Rosenthal, Table of n, a(n) for n = 0..106473
Programs
-
Maple
rev:=proc(f)local i,fr;fr:=[];for i to nops(f) do fr:=[op(fr),f[-i]]od;return fr;end:mc := z->`if`(z=0,[0],rev(convert(z,base,10))): matches := proc(f,z)local i,t,cnt;t:=mc(z);cnt:=0;for i to nops(f)+1-nops(t)do if f[i..i+nops(t)-1]=t then cnt := cnt+1;fi;od;return cnt;end: addZ := proc(f,z)local t;t:=mc(z);return[op(f),op(t)];end: s:=[]:a:=[]:for i from 0 to 54 do s:=addZ(s,i);m:=matches(s,i);s:=addZ(s,m);a:=[op(a),i,m];od:seq(a[i+1],i=0..109);
Comments