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.

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.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jan 11 2020

Keywords

Comments

In the first 10 million terms the most frequently seen digit difference is 1, which leads other digit difference counts for 2589052 terms. The least seen is 9, which only holds the lead for 990 terms and does not become the most frequently seen digit difference until a(23521), after a run of 1228 consecutive terms of 9090. The longest series of unchanging terms begins at a(7727945) = 7040480 which begins a run of 94553 consecutive terms of 7040480.

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.
		

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