Distinct Digits Function

Algebra Level 2

The function dd ( n ) \text{dd}(n) takes in a positive integer n n , and gives the number of distinct digits in n n , when written in base 10.

How many elements are there in the range of dd ( n ) \text{dd}(n) ?

As an explicit example, dd ( 1123 ) = 3 \text{dd}(1123) = 3 , since there are three distinct digits in 1123, namely 1, 2, and 3.

Infinitely many 11 10 8 9

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Hung Woei Neoh
May 16, 2016

dd ( n ) = \text{dd}(n) = number of distinct digits in n n at base 10 10

At base 10 10 , we have 10 10 different types of digits: 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 0,1,2,3,4,5,6,7,8,9

Each number must have at least 1 1 distinct digit, and it will have at most 10 10 distinct digits. A number can have 2 2 to 9 9 distinct digits too.

Therefore, the range of dd ( n ) , R dd = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } \text{dd}(n), R_{\text{dd}} = \{1,2,3,4,5,6,7,8,9,10\}

The number of elements in the range, n ( R dd ) = 10 n(R_{\text{dd}}) = \boxed{10}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...