OFFSET
1,1
COMMENTS
Method B = 'digit'-indication followed by 'frequency'.
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 1..23
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
KEYWORD
nonn,base,easy,nice
AUTHOR
STATUS
approved