How many of the 343 smallest positive integers written in base 7 use 4 or 5 (or both) as a digit?
Convert 343 in base 10 to base 7
343_10 =1 000_7
1 000_7 / 4_7 =152 fours
1 000_7 / 5_7 =125 fives.
1 000_7 / 45_7 =13 fours and fives.
Write ALL numbers from 1 to 342 in base 7 as 3 digits, such as the following:
000, 001, 002, 003, 004, 005, 006, 010, 011, 012, 013, 014, 015, 016.........and so on to 666, and 1000. This gives you a total of:
3 x 49 x 7 =1,029 digits in 342 numbers in base 7. Since each number from 0 to 6 is equally present in the above 1029 digits, it, therefore, follows that there are:1,029 / 7 =147 fours and 147 fives, in any combinations of the two.