How many numbers can be divided by 7? [closed]

Solution 1:

Notice the $7$-element groups of the numbers $a_9a_8a_7a_6a_5a_4a_3a_2a_1$ ($a_i$ are digits) where we fix all digits except $a_7$ and traverse the range $a_7=1,2,\ldots 7$.

In each of those groups, exactly one is divisible by $7$. This can be seen because those numbers all differ by $k\times 1,000,000$, where $0\le k\le 6$. As $7\not\mid 1,000,000$ and $7\mid k$ if and only if $k=0$, we have that none of the differences of two different numbers in this $7$-element set is divisible by $7$. Thus, those seven numbers all give different remainders when divided by $7$ and exactly one of those remainders has to be $0$.

This means that exactly one seventh of all $9!$ numbers will be divisible by $7$, i.e. the number of numbers divisible by $7$ will be $9!/7=51,840$.