Mark44 its the second time your saying that "it's easier to count how many numbers don't have a 7 digit" but its basically the same, when you count one you basically count the other and i don't really see why its easier. just a thought.
also the number 7 and 70 count as two occurrences because they are two different numbers and each has 1 occurrence of the digit 7.
But you right I counted some numbers twice!
and you're right on the money with 252 :)
Example for 100-999:
(107,117,127,...,197) + (207,...,297) + (307,...,397) + (...) + (907,...,997) = 10*9 = 90
(170,171,..179) + (270,..179) + (...) + (970,..979) = 10*9 -9 (No. 177,277,...,977) = 81
(700,701,...,799) = 100 - 10 (No. 707,717,...,797) - 9 (No. 770-779 without 777) = 81
=> grand total = 90+81+81= 252.
now we're mostly sure how many 7's are in 100-999 :)