A343102 a(n) is the sum of the number of times the digits in n (without repetition) have appeared in the sequence.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 2, 2, 2, 2, 2, 2, 2, 2, 19, 11, 8, 8, 8, 8, 8, 8, 14, 9, 11, 8, 8, 0, 1, 0, 0, 0, 8, 2, 16, 11, 10, 1, 1, 1, 2, 1, 10, 3, 17, 19, 10, 1, 1, 0, 1, 1, 9, 4, 20, 26, 14, 3, 5, 3, 2, 3, 11, 6, 21, 30, 15, 6, 4, 3, 5, 1, 10, 5, 31, 42, 24, 16, 15, 14, 14, 10
Offset: 0
Examples
a(0) to a(9) = 0 as the digits 0 to 9 have not appeared in the sequence. a(10) = 10 as 1 has not appeared while 0 has appeared ten times, thus a(10) = 0 + 10 = 10. a(11) = 1 as the repetitions of 1 in 11 are ignored, and 1 has appeared once in the sequence. a(12) = 2 as 1 has appeared twice while 2 has not appeared, thus a(12) = 2 + 0 = 2. a(20) = 19 as 2 has appeared eight times while 0 has appeared eleven times, thus a(20) = 8 + 11 = 19. a(22) = 8 as the repetitions of 2 in 22 are ignored, and 2 has appeared eight times in the sequence.
Links
- Scott R. Shannon, Image of the terms for n=0..1000000. The green line is a(n) = n.
Programs
-
Mathematica
Block[{a = {}, d = ConstantArray[0, 10]}, Do[AppendTo[a, Total@ Map[d[[If[# == 0, 10, #] ]] &, Union@ IntegerDigits[i]]]; Set[d, d + DigitCount[a[[i + 1]] ]], {i, 0, 87}]; a] (* Michael De Vlieger, Apr 05 2021 *)
Comments