login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022512 Describe previous term from the right (method A - initial term is 8). 2
8, 18, 1811, 211811, 21182112, 122112182112, 122112181112212211, 2122112231181112212211, 21221122311821132221221112, 12312211321321121821132221221112 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Method A = 'frequency' followed by 'digit'-indication.
LINKS
EXAMPLE
E.g., the term after 1811 is obtained by saying "two 1's, one 8, one 1", which gives 211811.
MATHEMATICA
split[n_]:=Split[Reverse[IntegerDigits[n]]];
list1[n_]:=List/@Length/@split[n]; riffle1[n_]:=Riffle[split[n], list1[n]];
tab[n_]:=Table[i, {i, 1, 2*Length[list1[n]], 2}];
list2[n_]:=Append[riffle1[n][[#]], riffle1[n][[#+1]]]&/@tab[n];
flat[n_]:=Flatten/@list2[n]; riffle2[n_]:=Riffle[Last/@flat[n], First/@flat[n]];
a[1]=8; a[n_]:=FromDigits[riffle2[a[n-1]]]; Array[a, 10] (* or *)
IntegerReverse[NestList[FromDigits[Flatten[Replace[Replace[Replace[Split[Reverse[IntegerDigits[#]]], {x_, y_}->{x, Length[{x, y}]}, {1}], {x_, y_, z_}->{x, Length[{x, y, z}]}, {1}], {x_}->{x, Length[{x}]}, {1}]]]&, 8, 9]] (* Ivan N. Ianakiev, Nov 10 2016 *)
CROSSREFS
Sequence in context: A001151 A177367 A138492 * A146299 A081968 A076096
KEYWORD
nonn,base,easy,nice
AUTHOR
EXTENSIONS
More terms from Erich Friedman
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)