login
Describe previous term from the right (method A - initial term is 0).
20

%I #15 Dec 17 2021 06:03:09

%S 0,10,1011,211011,21102112,122112102112,122112101112212211,

%T 2122112231101112212211,21221122311021132221221112,

%U 12312211321321121021132221221112

%N Describe previous term from the right (method A - initial term is 0).

%C Method A = 'frequency' followed by 'digit'-indication.

%H Reinhard Zumkeller, <a href="/A022506/b022506.txt">Table of n, a(n) for n = 0..21</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LookandSaySequence.html">Look and Say Sequence</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Look-and-say_sequence">Look-and-say sequence</a>

%F For n > 1: a(n+1) = A045918(A004086(a(n))). - _Reinhard Zumkeller_, Mar 02 2014

%e The term after 1011 is obtained by saying "two 1's, one 0, one 1", which gives 211011.

%t a[0] = 0;

%t a[n_] := a[n] = Split[IntegerDigits[a[n-1]]] /. L_List /; IntegerQ[L[[1]]] :> {Length[L], L[[1]]} // Reverse // Flatten // FromDigits;

%t a /@ Range[0, 9] (* _Jean-François Alcover_, Nov 26 2019 *)

%o (Haskell)

%o a022506 n = a022506_list !! n

%o a022506_list = 0 : 10 : iterate (a045918 . a004086) 1011

%o -- _Reinhard Zumkeller_, Mar 02 2014

%Y Cf. A006711, A022482, A022507-A022513.

%K nonn,base,easy,nice

%O 0,2

%A _N. J. A. Sloane_

%E More terms from _Erich Friedman_