Index of a permutation that has repetition [closed]

$\color{red}{\text{Warning!}}$ I am writing this answer to show the mathematical approach , but this is very cumbersome , so i recommend you to use computer program instead of combinatorical approach.

Saying that the first digit can be zero , make our work easier.I think saying "strings" instead of "digits" can be more appropriate in that sense.Anyway , lets turn our attention.I think that the best way to count these numbers is to use exponential generating functions.Otherwise ,it would be so cumbersome to deal with .

As you indicated ,a number can repeat at most $3$ times because there is $8$ distinct number in this string of lenght $10$.Then , the E.G.F of each number can be $$\bigg(x + \frac{x^2}{2!}+\frac{x^3}{3!}\bigg)$$

Now , for $3749832414$, we must firstly count how many string there are such that starting with $0$ , $1$ ,$2$.

  • For the strings start with $0$ :

If it starts with zero , then the E.G.F form of zero is $$\bigg(x + \frac{x^2}{2!} \bigg)$$ Now choose the rest $7$ digits by $\binom{9}{7}$.

So ,the number of strings of lenght $10$ starting with zero and containg $8$ distinct numbers is : $$[x^{10}]\bigg(x + \frac{x^2}{2!}+\frac{x^3}{3!}\bigg)^7\bigg(x + \frac{x^2}{2!}\bigg)$$

This calculation is also valid for those strings that start with $1$ or $2$ .So when we come up to the strings starst with $3$ there are $3 \times [x^{10}] \times \binom{9}{7}$ strings.

  • For starting with $30$ :

We need to select $6$ numbers among the rest $8$ by $\binom{8}{6}$ , and find $$[x^{10}]\bigg(x + \frac{x^2}{2!}+\frac{x^3}{3!}\bigg)^6\bigg(x + \frac{x^2}{2!}\bigg)^2$$

This is valid for starting with $31,32,34,35,36$ ,so $$6 \times \binom{8}{6}[x^{10}]$$

However ,for those starting with $33$ , the E.G.F is $$[x^{10}]\bigg(x + \frac{x^2}{2!}+\frac{x^3}{3!}\bigg)^7\bigg(x \bigg)$$

Moreover, we must select $7$ numbers instead of $6$ ,so $$\binom{9}{7}[x^{10}]\bigg(x + \frac{x^2}{2!}+\frac{x^3}{3!}\bigg)^7\bigg(x \bigg)$$

Now , you must the number of strings starting with $370,371,372,373$ using the same logic.This process will be applied for each next digits.I hope you understand the logic.

However, this is very cumber some as i said , so i would recommend you to use computer program.