Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 4
- count, summa = 0, 0
- for i in range(12094, 20075):
- if (i%16==15) and (i%3==0) and (i%8!=0) and (i%14!=0) and (i%19!=0):
- count += 1
- summa += i
- print('Problem #4', summa, count)
- # 6
- count, m = 0, 0
- for i in range(2461, 9720):
- s = str(i)
- if '3'<=s[-2]<='7' and s[-3] != '1' and s[-3] != '9':
- count += 1
- m = i
- print('Problem #6', count, m)
- # 5
- minimum, maximum = 8300, 0
- for i in range(3232, 8300):
- if (i%2==0 or i%7==0) and i%15!=0 and i%28!=0 and i%41!=0:
- if i<minimum:
- minimum = i
- if i > maximum:
- maximum = i
- print('Problem #5', minimum, maximum)
- # 8
- for i in range(100, 1000):
- x = i
- L = x - 30
- M = x + 30
- while L != M:
- if L > M:
- L = L - M
- else:
- M = M - L
- if M == 30:
- print('Problem #8', x)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement