A118668 Number of distinct digits needed to write the n-th triangular number in decimal representation.
1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 1, 3, 3, 3, 3, 3, 3, 3, 2, 4, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 4, 2, 3, 4, 3, 4, 4, 3, 4, 2, 3, 4, 4, 4, 3, 3, 4, 3, 4, 3, 2, 4, 4, 4, 3, 3, 4, 4, 3, 4, 3, 4, 3, 4, 4, 4, 4, 3, 4, 3, 4, 4, 4, 2, 2, 3, 3, 4
Offset: 0
Examples
n=99: 99*(99+1)/2 = 4950 -> a(99) = #{0,4,5,9} = 4; see A119033 for an overview of sequences with terms composed of not more than 3 distinct digits. n=100: 100*(100+1)/2 = 5050 -> a(100) = #{0,5} = 2;
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
a118668 = a043537 . a000217 a118668_list = map a043537 a000217_list -- Reinhard Zumkeller, Jul 11 2015
-
Mathematica
Length[Union[IntegerDigits[#]]]&/@Accumulate[Range[0,110]] (* Harvey P. Dale, Jul 23 2012 *)
Comments