1
$\begingroup$

I'm trying to find the number of ways to form a number with certain properties.

The number has following properties.

The first digit is always 1.

The $n$th digit can take values from 1 to k+1 where k is the maximum digit that is appearing in 1st to (n-1)th digit.

so when n = 1 you only have 1. when n = 2 you have 11 and 12. when n = 3 you have 111, 112, 121, 122, 123, but you cant have 113. for n=4, you have 1111, 1112, 1121, 1122, 1123, 1211,1212, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 1234.

any help in form of any direct formula and recursive formula?

  • 0
    Are you assuming these are decimal digits (so each digit is $\le 9$)?2012-04-02
  • 0
    Fine. Lets assume that n is between 1 and 9.2012-04-02

1 Answers 1