First, we will sum all four digit numbers that you can make with

. The first ones (from

to

) are:
Looking at the table above, it is easy to note that:

Thus the sum of all possible four digit numbers is:

Proceed in a similar way to calculate the sum of the five digit numbers.