Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #coding: cp1251
- def delimost(x):
- temp = str(x)
- res = 0
- if int(temp[-2:0]) % 2 == 0:
- res += 1
- if temp[-1] == 5 or 0:
- res += 1
- if (x - (int(temp[-1]) * 2)) % 7 == 0:
- res += 1
- if temp[-1] == 0 and int(temp[-2:-1]) % 2 == 0:
- res += 1
- tmp1, tmp2 = temp[::2], temp[1::2]
- if int(tmp1) == int(tmp2) or abs(int(tmp1) - int(tmp2)) % 11 == 0:
- res += 1
- tmp1 = int(temp[:-1])
- tmp2 = int(temp[-1] * 4)
- if tmp1 + tmp2 % 13 == 0:
- res += 1
- tmp1 = int(temp[-2:-1])
- tmp2 = int(temp[-1] * 5)
- if (tmp1 - tmp2) % 17 == 0:
- res += 1
- tmp1 = int(temp[-2:-1])
- tmp2 = int(temp[-1] * 2)
- if (tmp1 + tmp2) % 19 == 0:
- res += 1
- if temp[-1] == 0 and int(temp[-2:-1]) % 2 == 0:
- res += 1
- if res == 9:
- return True
- else:
- return False
- t = 20
- while t:
- if delimost(t) == True:
- t = False
- print t
- else:
- t += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement