Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import print_function
- import numpy as np
- def bbs_p(n):
- x = np.zeros(n, dtype=np.int64)
- x[0] = 9
- for i in range(1, n):
- x[i] = pow(int(x[i-1]), 2, 11*3)
- return x
- def bbs(n):
- x = np.zeros(n, dtype=np.int64)
- x[0] = 9
- for i in range(n-1):
- x[i+1] = (x[i]**2) % (11*3)
- return x
- def bbs_i(n):
- x = [9]
- for i in range(n-1):
- x.append(pow(x[i], 2, 3*11))
- return x
- if __name__ == "__main__":
- n = 10
- print(*bbs_p(n))
- print(*bbs (n))
- print(*bbs_i(n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement