For numbers with l+1 digits, there are floor(9/k) (say a) options per digit, hence the total number of numbers should be a^(l+1). Similarly, for l+2 digits, a^(l+2). So on for r digits, a^(r).
Shouldn't the answer be the sum of these numbers?
a^(l+1) + a^(l+2) + .... + a^r