A022516 Describe previous term from the right (method B - initial term is 5).
5, 51, 1151, 115112, 21125112, 211251211221, 112212211151211221, 1122122111511322112212, 21112212223112511322112212, 21112212223112512112312311221321
Offset: 0
Examples
The term after 1151 is obtained by saying "1 once, 5 once, 1 twice", which gives 115112.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..21
Programs
-
Haskell
import Data.List (group, transpose) a022516 n = a022516_list !! n a022516_list = 5 : f [5] :: [Integer] where f xs = (read $ concatMap show ys) : f ys where ys = concat $ transpose [map head zss, map length zss] zss = reverse $ group xs -- Reinhard Zumkeller, Jan 26 2014
Extensions
More terms from Patrick De Geest, Jun 15 1999
Comments