Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [0, 1, 2, 4, 5]
- h1 = lambda x: x % 7
- h2 = lambda x: (x+3) % 7
- n = 10
- m = 0
- mm = 10
- for n in range(10, 51):
- i = 0
- while (h1(n) + i*h2(n)) % 7 in a:
- i += 1
- if i > 1000:
- break
- if i > m and i < 1000:
- m = i
- mm = n
- print(i, n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement