> for x in range(20000): > if x % 7 == 0: And reading this, it occurs to me that you could do this with a range stride of 7 as well: for x in range(0, 200, 7): # <--- count by 7s for y in range(2, 7): if x%y == 1: print x break -clay