OFFSET
0,5
COMMENTS
This sequence sums the previous digits the same way as A309261, except that here digits in a(n-1) are not considered unique, so each digit in a(n-1) is summed regardless of the number of times it appears in a(n-1). This leads to this sequence being the same as A309261 up to a(66) = 22, after which they diverge.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 0..19999
Scott R. Shannon, Plot of a(n) for n = 0..10^6 [This is a dramatic graph - N. J. A. Sloane, Oct 21 2019]
EXAMPLE
a(2) = 1, as a(1) = 0, and '0' has occurred one previous time in the sequence before a(1).
a(62) = 2, as a(61) = 9, and '9' has occurred two previous times. '2' has now occurred 10 times in the sequence.
a(66) = 22, as a(65) = 10, and '1' has occurred ten previous times, and '0' has occurred twelve previous times, and 10 + 12 = 22.
a(67) = 20, as a(66) = 22, and '2' has occurred ten previous times, and '2' has occurred ten previous times, and 10 + 10 = 20.
PROG
(Python)
from collections import Counter
from itertools import count, islice
def agen(): # generator of terms
an, c = 0, Counter()
while True:
yield an
s = str(an)
an = sum(c[d] for d in s)
c.update(s)
print(list(islice(agen(), 82))) # Michael S. Branicky, Mar 24 2025
CROSSREFS
KEYWORD
AUTHOR
Scott R. Shannon, Oct 20 2019
STATUS
approved
