Numbers theory, combinatorics

78 Views Asked by At

How many numbers up to $1000$ are there such that the sum of digits is divisible by $7$ and the number itself is divisible by $3$?

1

There are 1 best solutions below

0
On

Possible sums of digits that are divisible by 3: 3,6,9,12,15,21,24,27

Possible sums that are also divisible by 7: 21

One possible such number is 678. Six numbers can be formed using the digits 6, 7, and 8:

678, 687, 768, 786, 867, 876

But there is only one way to write those digits in increasing order: 678

So we need only to find the numbers whose digits (1): sum to 21 and (2): are in increasing order. The other numbers will just be those numbers with the digits rearranged.

\begin{array}{|c|c|} \hline \text{number} & \text{number of distinct rearrangements} \\ \hline 399 & 3 \\ 489 & 6 \\ 579 & 6 \\ 669 & 3 \\ 588 & 3 \\ 678 & 6 \\ 777 & 1 \\ \hline \text{TOTAL} & 28\\ \hline \end{array}