482,245 views
14 votes
14 votes
Write a python program to calculate the sum of numbers from 1 to 20 which is divisible by 3.

User Avrumie
by
2.7k points

2 Answers

22 votes
22 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 Brendon Vdm
by
2.8k points
13 votes
13 votes

Answer:

Input : N = 5

Output : 7

sum = 3 + 4

Input : N = 12

Output : 42

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

User AConsumer
by
2.8k points