Is divisible by ?
Created on Jan. 22, 2018 by Antoine Angot
Create a program to find and print all numbers between from 0 to 1000 (both included), that are divisible by 7 and whose digits sum are divisible by 3.
For instance, 1512
is divisible by 7
and the sum of all its is
digits (9
) is divisible by 3
.
Another example, 21
is divisible by 7
, and the sum of its digits
(3
) is divisible by 3
.
Example
If the exercise were to make the same computation but in the range(1500, 1700)
,
the solution should print:
$ ./solution.py
1512
1533
1554
1575
1596
1617
1638
1659
1680