Suppose I have a number $120$. I want to find the number of permutations its digits can have to form other numbers except the ones with leading zeroes.
For example, its permutations can be $120, 210, 201, 102, 012, 021$, which is $6$ or $n!$. However, I require $4$ (excluding the values with leading zeroes).
How can this be generalized to larger numbers?
In general, if you have a number with $n_0$ $0$'s, $n_1$ $1$'s, $n_2$ $2$'s, and so on, the number of permutations of these is $$ \frac{(n_0+n_1+n_2+n_3+n_4+n_5+n_6+n_7+n_8+n_9)!}{n_0!n_1!n_2!n_3!n_4!n_5!n_6!n_7!n_8!n_9!}. $$ What this does is to count all the permutations as if all the numbers were different, and then divides by the ways to rearrange the repeats to remove double counting. The problem with is is that it also allows leading $0$'s. Our goal will be to subtract the leading $0$'s from this count.
If $n_0=0$, then there are no zeros, so this count is the total count in this case. If $n_0\not=0$, we place one of the zeros in the first position, leaving $n_0-1$ zeros for the rest of the number. Then, we arrange the remaining numbers just as before. So, we have $$ \frac{((n_0-1)+n_1+n_2+n_3+n_4+n_5+n_6+n_7+n_8+n_9)!}{(n_0-1)!n_1!n_2!n_3!n_4!n_5!n_6!n_7!n_8!n_9!}. $$ ways for the leading entry to be $0$.
Subtracting the second expression from the first gives the count you're looking for.
Examples:
In your first example, $120$, $n_0=1$, $n_1=1$, $n_2=1$, and all other $n_i$'s are $0$. Therefore, the number of possible permutations is $$ \frac{(1+1+1)!}{1!1!1!}=3!=6. $$ On the other hand, the number of numbers that start with $0$ is $$ \frac{((1-1)+1+1)!}{(1-1)!1!1!}=\frac{2!}{0!1!1!}=2!=2. $$ Subtracting these two gives $6-2=4$ ways to write a number without leading $0$'s
In your second example, $5500$, we have that $n_0=2$, $n_5=2$, and all other $n_i$'s are $0$. Therefore, the total number of permutations is $$ \frac{(2+2)!}{2!2!}=\frac{4!}{2!2!}=\frac{24}{2\cdot 2}=6. $$ On the other hand, the number of permutations starting with zero is $$ \frac{((2-1)+2)!}{(2-1)!2!}=\frac{3!}{1!2!}=\frac{6}{1\cdot 2}=3. $$ The difference is $3$, which is the number of permutations that don't start with $0$.