def isdivisible(n): divisors = [19,18,17,16,15,14,13,11] for x in range(0,8): #Checks if value is divisible by numbers 2-20 (1 is not necessary to check) if n % divisors[x] != 0: return False return True valuefound = False counter = 20 while valuefound == False: if isdivisible(counter) == True: valuefound == True print("**Result**:",counter) break else: print(counter) counter+=20 #increment by the largest required multiple