OFFSET
1,2
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.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..23
EXAMPLE
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.
MATHEMATICA
NestList[FromDigits@ Flatten@ Map[Join[IntegerDigits[#2 + 1], IntegerDigits[#1]] & @@ # &, Apply[Join, Tally /@ SplitBy[IntegerDigits[#]]]] &, 1, 12] (* Michael De Vlieger, Dec 29 2022 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Dec 21 2022
STATUS
approved
