Count the amount of passwords How can I count the amount of $8$-digit passwords fitting in the following criteria: the sum of first four digits is divisible by $5$ and the sum of all digits is divisible by $10$? Usually I use the combinatorics formulas, but the sum division condition doesn't allow me to do it.
 A: You can still use combinatorics .. it's just takes a little more thinking!
Also, here's a little
HINT
After the first $3$ digits, whatever they are, how many options are there for the $4$-th digit to make sure the sum of the first four is divisible by $5$?
Use the same kind of thinking to deal with the sum of all digits: after the first $7$ digits, how many options are there for the $8$-th to make the sum of all eight digits divisible by $10$?
Answers here:

 Whatever the first $3$ digits are, there are always exactly $2$ choices for the $4$-th digit to make their sum divisible by $5$ . For example if the sum of the first $3$ is $16$, then for the $4$-th you can pick $4$ or $9$.  If the sum of the first $3$ is $12$, then you can pick $3$ or $8$. etc. See how there are always exactly two options?


 Likewise, whatever the first $7$ digits are, there is exactly $1$ choice for the $8$-th digit to make their sum divisible by $10$

 Hence, you can choose anything for digits $1$ through $3$, for digit $4$ you then have $2$ options, then again anything for digits $5$ through $7$, and then there is only one choice for digit $8$.


 Total: $2 \cdot 10^6$

