A326834 a(0) = 0; a(1) = 0; for n > 0, a(n) = the sum of the number of times each digit in a(n-1) has occurred from a(0) to a(n-2) inclusive.
0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 12, 3, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4, 3, 5, 1, 5, 2, 5, 3, 6, 1, 6, 2, 6, 3, 7, 1, 7, 2, 7, 3, 8, 1, 8, 2, 8, 3, 9, 1, 9, 2, 9, 3, 10, 22, 20, 25, 17, 15, 17, 18, 18, 20, 28, 21, 32, 28, 25, 25, 27
Offset: 0
Examples
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.
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]
Programs
-
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
Comments