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.
%I A309261 #25 Mar 24 2025 11:40:08 %S A309261 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, %T A309261 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, %U A309261 22,10,24,16,16,18,18,20,27,18,22,15,21,35,16,25,24,24 %N A309261 The sum of the number of times each unique digit in the previous number occurred in the numbers before that with a(1) = 0. %H A309261 Rémy Sigrist, <a href="/A309261/b309261.txt">Table of n, a(n) for n = 1..20000</a> %H A309261 Rémy Sigrist, <a href="/A309261/a309261.png">Density plot of the first million terms</a> %e A309261 For n=2, the previous term a(1) is 0 by definition and the digit 0 has never been seen before so a(2) is 0. %e A309261 For n=3, a(2) is 0, the digit 0 has been seen once before so a(3) is 1. %e A309261 For n=22, a(21) is 10, digit 1 has been seen once before a(21) and digit 0 has been seen eleven times, so a(22) = 12. %e A309261 For n=68, a(67) is 22, digit 2 has been seen ten times before, we only consider unique digits of a(n-1), so a(68) = 10. %o A309261 (PARI) { f=vector(base=10); for(n=1, 84, if(n==1, v=0, d=if(v, digits(v, base), [0]); s=Set(d); v=sum(i=1, #s, f[1+s[i]]); apply(t -> f[1+t]++, d)); print1(v ", ")) } \\ _Rémy Sigrist_, Jul 24 2019 %o A309261 (Python) %o A309261 from collections import Counter %o A309261 from itertools import count, islice %o A309261 def agen(): # generator of terms %o A309261 an, c = 0, Counter() %o A309261 while True: %o A309261 yield an %o A309261 s = str(an) %o A309261 an = sum(c[d] for d in set(s)) %o A309261 c.update(s) %o A309261 print(list(islice(agen(), 84))) # _Michael S. Branicky_, Mar 24 2025 %Y A309261 Cf. A004207. %K A309261 nonn,base %O A309261 1,5 %A A309261 _Nic Tomlinson_, Jul 19 2019