← Previous Next →

Is divisible by ?

Created by Antoine Angot

Instructions

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 is digits is 9 and is divisible by 3.

Example

If the exercice 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

Results