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!)
A022510 Describe previous term from the right (method A - initial term is 6). 0

%I #21 Apr 05 2020 13:34:57

%S 6,16,1611,211611,21162112,122112162112,122112161112212211,

%T 2122112231161112212211,21221122311621132221221112,

%U 12312211321321121621132221221112

%N Describe previous term from the right (method A - initial term is 6).

%C Method A = 'frequency' followed by 'digit'-indication.

%e E.g., the term after 1611 is obtained by saying "two 1's, one 6, one 1", which gives 211611.

%t a[1]=6; a[n_]:= a[n]= IntegerReverse[ FromDigits[ Flatten[ Replace[ Replace[ Replace[ Split[ IntegerDigits[a[n-1]]], {x_,y_}->{x,Length[{x,y}]},{1}], {x_,y_,z_}->{x,Length[{x,y,z}]},{1}], {x_}->{x,Length[{x}]},{1}]]]];

%t Array[a,10] (* _Ivan N. Ianakiev_, Jul 23 2019 *)

%o (Python)

%o from re import split

%o A022510_list, l = [6], '6'

%o for _ in range(10):

%o l = ''.join(str(len(d))+d[0] for d in split('(0+|1+|2+|3+|4+|5+|6+|7+|8+|9+)',l[::-1]) if d)

%o A022510_list.append(int(l)) # _Chai Wah Wu_, Jan 02 2015

%Y Cf. A022506, A006711, A022482, A022507, A022508, A022509, A022511, A022512, A022513.

%K nonn,base,easy,nice

%O 0,1

%A _N. J. A. Sloane_

%E More terms from _Erich Friedman_

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)