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!)
A022470 Describe the previous term! (method B - initial term is 2). 15
2, 21, 2111, 2113, 211231, 2112213111, 211222113113, 21122312311231, 2112223111213112213111, 21122331132111311222113113, 211222321231211331122312311231, 21122331211121311121123212223111213112213111, 21122232112113211131132112213121112331132111311222113113 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Method B = 'digit'-indication followed by 'frequency'.
LINKS
EXAMPLE
E.g., the term after 2113 is obtained by saying "2 once, 1 twice, 3 once", which gives 211231.
MATHEMATICA
a[1] = 2; a[n_] := a[n] = FromDigits[Flatten[{First[#], Length[#]} & /@ Split[IntegerDigits[a[n - 1]]]]]; Map[a, Range[1, 23]] (* Peter J. C. Moses, Mar 22 2013 *)
PROG
(Python)
from itertools import accumulate, groupby, repeat
def summarize(n, _):
return int("".join(k+str(len(list(g))) for k, g in groupby(str(n))))
def aupton(nn): return list(accumulate(repeat(2, nn), summarize))
print(aupton(13)) # Michael S. Branicky, Feb 21 2021
CROSSREFS
Cf. A006751 (method A).
Sequence in context: A052157 A050204 A368188 * A080815 A351580 A276654
KEYWORD
nonn,base,easy,nice
AUTHOR
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 July 24 22:37 EDT 2024. Contains 374585 sequences. (Running on oeis4.)