|
|
A022517
|
|
Describe previous term from the right (method B - initial term is 6).
|
|
4
|
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Method B = 'digit'-indication followed by 'frequency'.
|
|
LINKS
|
|
|
EXAMPLE
|
The term after 1161 is obtained by saying "1 once, 6 once, 1 twice", which gives 116112.
|
|
PROG
|
(Haskell)
import Data.List (group, transpose)
a022517 n = a022517_list !! n
a022517_list = 6 : f [6] :: [Integer] where
f xs = (read $ concatMap show ys) : f ys where
ys = concat $ transpose [map head zss, map length zss]
zss = reverse $ group xs
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|