A five digit number $\overline{a_1 a_2 a_3 a_4 a_5}$ is said to satisfy property P if $a_i \in \{1,2,3,4,5,6,7 \} \quad 1\leq \forall i \leq 5$. How many five digit numbers satisfy P such that $k=a_1+a_2+a_3+a_4+a_5$ is divisible by:
(a) $3$
(b) $2$
(c) $4$
(Separate sub questions).
The first method(which is really lengthy but worked) is separating each $a_i$ into remainders when divided by $3,2,4$ respectively and doing all lot of case work for the digital sum divisibility condition.
The final answer is of a very nice form:
(a)$\frac{7^5-1}{3}$ (b)$\frac{7^5-1}{2}$ (c)$\frac{7^5-3}{4}$
So I thought there should be a better approach. Although the number of five digits numbers leaving a particular remainder when divided by $3$ or $2$ or $4$ won't be equal, as the groups which each $a_i$ is divided into based on remainder(this isn't needed for the question though), are of unequal sizes(for all three cases). But given the answer form, I wondered if it is true that when the digital sum k is divided by a number, then they are equally distributed among all the possible remainders.
For example for case (a), we can divide $k \in [5,35]$ into groups of $3$ based on remainder when divided by $3$, then the groups are of sizes $10$ ($0 \mod 3$), $10$ ($1 \mod 3$), $11$ ($2 \mod 3$). The extra number in the last group ($2 \mod 3$) is $5$, and only one five number has $k=5$.
So is it correct to say that the from the total $7^5$ possible numbers, if we subtract this extra number to give a total $7^5-1$ numbers, these are equally divided into the three groups to give a total number of $\frac{7^5-1}{3}$ numbers(the answer)? Similar reasoning for case (b),(c).
Is there any other way to solve this question? I briefly also tried using multinomial theorem and got that the required answer for case(a) is the sum of coefficients of $x^{3n}, n=0,1,2,3,\ldots$ in the expansion of $(x+x^2+\ldots+x^7)^5$ but I could make little to no progress in evaluating this.