A331163 a(n) is the number of occurrences of the most frequently seen difference between adjacent digits in the concatenation of a(0) to a(n-1), with a(0) = 0, a(1) = 0.
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 21, 21, 21, 22, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 30, 31, 31, 31, 31, 31
Offset: 0
Examples
a(2) = 1 as the concatenation of a(0) and a(1) = '00', and the only adjacent digit difference in '00' is 0, and that difference has occurred one time. a(3) = 1 as the adjacent digit differences in '001' are 0 and 1, both of which have occurred one time. a(4) = 2 as '0011' contains two pairs of adjacent digits which differ by 0. a(22) = 12 as '001122334455667788991010' contains twelve pairs of adjacent digits which differ by 1.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Crossrefs
Cf. A040115.
Programs
-
Maple
DC:= [0]: last:= 0: Res:= 0,0: Ct:= Array(0..9): Ct[0]:= 1: for n from 2 to 100 do v:= max(Ct); Res:= Res, v; L:= [last,op(ListTools:-Reverse(convert(v,base,10)))]; DL:= map(abs,L[2..-1]-L[1..-2]); last:= L[-1]; for i from 1 to nops(DL) do Ct[DL[i]]:= Ct[DL[i]]+1 od; od: Res; # Robert Israel, Jan 16 2020
Comments