OFFSET
0,5
COMMENTS
If d is the last digit of a(n-1), and d has occurred as last digit of a(j), 0 <= j < n-1, a total of k times, then a(n) = k (compare with A248034).
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
Michael De Vlieger, Scatterplot of a(n), n = 0..1024, with a color function showing r = a(n-1) mod 10 in black if r = 0, red if r = 1, ..., magenta if r = 9.
EXAMPLE
a(1) = 0 because a(0) = 0 has been repeated 0 times. a(2) = 1 because a(1) = 0 has been repeated once.
a(22) = 11 has last digit 1, and there has been only one occurrence of a prior term having 1 as last digit (a(2) = 1), therefore a(23) = 1.
a(53) = 2 (last digit is 2) and there are 9 prior terms with last digit = 2 (8 terms = 2, and a(40) = 12). Therefore a(54) = 9.
MATHEMATICA
nn = 120; a[0] = j = 0; c[_] := 0; Do[(a[n] = c[#]; c[#]++) &[Mod[j, 10]]; j = a[n], {n, nn}]; Array[a, nn, 0] (* Michael De Vlieger, Aug 08 2023 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David James Sycamore, Aug 07 2023
EXTENSIONS
More terms from Michael De Vlieger, Aug 08 2023
STATUS
approved