Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 720720 #LCM of integers 1-20
- divisors = [11,12,13,14,15,16,17,18,19,20] #Remove factors of integers 1-20 from the list of integers 1-20
- while True:
- if (count % divisors[0] == 0 and count % divisors[1] == 0 and count % divisors[2] == 0 and count % divisors[3] == 0 and count % divisors[4] == 0 and count % divisors[5] == 0 and count % divisors[6] == 0 and count % divisors[7] == 0 and count % divisors[8] == 0 and count % divisors[9] == 0):
- break
- else:
- count = (count + 2) #Increase count by 2 to avoid odd numbers
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment