cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A359223 A "look-and-say" sequence. Describe the previous term by overstating the digit count by 1. a(1) = 1.

Original entry on oeis.org

1, 21, 2221, 4221, 243221, 2224233221, 422422333221, 24322432433221, 2224233224232224333221, 42242233322422234224433221, 243224324332244223243234333221, 22242332242322243332343223222423222324433221, 42242233322422234224432223242332234224222342232234333221
Offset: 1

Views

Author

Tamas Sandor Nagy, Dec 21 2022

Keywords

Comments

The method mirrors that of the classic A005150 method A, with this modification: 1 is added to the true frequency, followed by digit-indication. The initial term is 1, and in our description for the next term we overstate by 1 how many 1's we see: "two 1's", that is 21.

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.
		

Crossrefs

Cf. A005150, A022472 (number of 2's in a(n)).

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
Showing 1-1 of 1 results.