login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A364788
a(0) = 0; thereafter a(n) is the number of times the last digit of a(n-1) has occurred as last digit in all terms prior to a(n-1).
2
0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 11, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 12, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 13, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3, 10, 14, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4, 10
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, 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
Cf. A248034.
Sequence in context: A142150 A276457 A171181 * A309261 A326834 A034948
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from Michael De Vlieger, Aug 08 2023
STATUS
approved