OFFSET
1,5
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..20000
Rémy Sigrist, Density plot of the first million terms
EXAMPLE
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.
For n=3, a(2) is 0, the digit 0 has been seen once before so a(3) is 1.
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.
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.
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Nic Tomlinson, Jul 19 2019
STATUS
approved