%I #15 Dec 05 2014 09:09:36
%S 6,61,1161,116112,21126112,211261211221,112212211161211221,
%T 1122122111611322112212,21112212223112611322112212,
%U 21112212223112612112312311221321
%N Describe previous term from the right (method B - initial term is 6).
%C Method B = 'digit'-indication followed by 'frequency'.
%H Reinhard Zumkeller, <a href="/A022517/b022517.txt">Table of n, a(n) for n = 0..21</a>
%e The term after 1161 is obtained by saying "1 once, 6 once, 1 twice", which gives 116112.
%o (Haskell)
%o import Data.List (group, transpose)
%o a022517 n = a022517_list !! n
%o a022517_list = 6 : f [6] :: [Integer] where
%o f xs = (read $ concatMap show ys) : f ys where
%o ys = concat $ transpose [map head zss, map length zss]
%o zss = reverse $ group xs
%o -- _Reinhard Zumkeller_, Jan 26 2014
%Y Cf. A022481, A022488, A022514-A022520.
%K nonn,base,easy,nice
%O 0,1
%A _N. J. A. Sloane_
%E More terms from _Patrick De Geest_, Jun 15 1999
|