12.8k views
5 votes
Write a python program to calculate the sum of numbers from 1 to 20 which is divisible by 3.

User Nazarudin
by
3.0k points

2 Answers

5 votes

Answer:Input : n = 2, number = 7

Output : 728

There are nine n digit numbers that

are divisible by 7. Numbers are 14+

21 + 28 + 35 + 42 + 49 + .... + 97.

Input : n = 3, number = 7

Output : 70336

Input : n = 3, number = 4

Output : 124200

Step-by-step explanation:

User Krystine
by
3.5k points
4 votes

Answer:

Input : N = 5

Output : 7

sum = 3 + 4

Input : N = 12

Output : 42

sum = 3 + 4 + 6 + 8 + 9 + 12

User Niall Byrne
by
4.1k points