|
|
A022519
|
|
Describe previous term from the right (method B - initial term is 8).
|
|
5
|
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Method B = 'digit'-indication followed by 'frequency'.
|
|
LINKS
|
|
|
EXAMPLE
|
The term after 1181 is obtained by saying "1 once, 8 once, 1 twice", which gives 118112.
|
|
PROG
|
(Haskell)
import Data.List (group, transpose)
a022519 n = a022519_list !! n
a022519_list = 8 : f [8] :: [Integer] where
f xs = (read $ concatMap show ys) : f ys where
ys = concat $ transpose [map head zss, map length zss]
zss = reverse $ group xs
(Python)
from itertools import groupby
for _ in range(10):
A022519_list.append(int(''.join(str(k)+str(len(list(g))) for k, g in groupby(str(A022519_list[-1])[::-1])))) # Chai Wah Wu, Sep 01 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|