Answer to Question #220523 in Python for raj

Question #220523

Indivisible Numbers

You are given a positive integer

N. Your task is to find the number of positive integers K <= N such that K is not divisible by any of the following numbers 2, 3, 4, 5, 6, 7, 8, 9, 10.Input

The first line of input is an integer

N.Output

The output should be an integer representing the number of positive integers satisfying the above condition.

Explanation

In the given example,

11 is not divisible by any number from 2 to 10. It is divisible by only 1, 11.So, the output should be

2.


1
Expert's answer
2021-07-25T16:02:54-0400
N=int(input("Enter a positive integer: "))


find=0
for ​K in range (1,N+1):
    if (N%K==0):
        find +=1
print(find)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS