A359223 A "look-and-say" sequence. Describe the previous term by overstating the digit count by 1. a(1) = 1.
1, 21, 2221, 4221, 243221, 2224233221, 422422333221, 24322432433221, 2224233224232224333221, 42242233322422234224433221, 243224324332244223243234333221, 22242332242322243332343223222423222324433221, 42242233322422234224432223242332234224222342232234333221
Offset: 1
Examples
Looking at a(3) = 2221 we see three 2's and one 1, but we overstate these counts by 1, saying "four 2's, two 1's", therefore a(4) = 4221.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..23
Programs
-
Mathematica
NestList[FromDigits@ Flatten@ Map[Join[IntegerDigits[#2 + 1], IntegerDigits[#1]] & @@ # &, Apply[Join, Tally /@ SplitBy[IntegerDigits[#]]]] &, 1, 12] (* Michael De Vlieger, Dec 29 2022 *)
-
Python
from itertools import accumulate, groupby, islice, repeat def LL(s, _): return "".join(str(len(list(g))+1)+k for k, g in groupby(s)) def agen(): yield from map(int, accumulate(repeat("1"), LL)) print(list(islice(agen(), 13))) # Michael S. Branicky, Dec 24 2022
Comments