Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 325396
- b = [2, 0] * (n + 1)
- b[2] = 0
- d = 0
- y = len(b)
- #0 - простое
- def f():
- for i in range(3, round(325396.0 ** 0.5) + 1, 2):
- if b[i] == 0:
- for j in range(2*i, y, i):
- b[j] = i
- #236228; 305283
- f()
- for i in range(278932, 325396):
- k = 0
- a = i
- sch = 0
- if b[a] != 0:
- c = b[a] % 10
- a = a // b[a]
- if b[a] != 0 and c == b[a] % 10:
- a = a // b[a]
- if b[a] == 0 and c == a % 10:
- d = d + 1
- # while b[a] != 0 and sch != 1:
- # a = a // b[a]
- # sch = sch + 1
- # if c != b[a] % 10:
- # k = 1
- # if b[a] == 0 and sch == 1 and c == b[a] % 10 and k == 0:
- # d = d + 1
- print(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement