The number involving more than 6 is 10*9*8*7*6*5*4 for the ordered 7 different digits which can be placed in 8 different ways (ie 8 spaces for the last digit to go into) and 10 choices for the last digit to go in

total=9*8*7*6*5*4*8*10 =10*9*8*(8*7*6*5*4)

This counts those with 7 and 8 different digits

For the number involving less than 6 (ie at least 4 the same) there 10 ways of choosing the repeated at least 4 times and 8*7*6*5/4! choices of how to arrange them in the 8 digit number. The remaing 4 positions can be filled with anything ie 10^4 possibilities

Giving a total of 10^4*10*(8*7*6*5)/4! = 10^5*(8*7*6*5*4)/3!

So not involving exactly 6 is

10*9*8*(8*7*6*5*4) + 10^5*(8*7*6*5*4)/3!

= 10*(8*7*6*5*4)(9*8 +10^4/3!)

Since there are 8^10 possible sequences then the total with exactly 6 is

8^10 - 10*(8*7*6*5*4)(9*8 +10^4/3!)