Advertisement
Guest User

Untitled

a guest
Nov 18th, 2021
19
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n=2**95+1
  2. a=0
  3.  
  4. def encoding(x):
  5. newinit=0
  6. for i in range(95):
  7. if x & 1:
  8. x = (x * 3 + 1) >> 1
  9. s=1
  10. else:
  11. x = x >> 1
  12. s=0
  13. newinit += s << (94 - i)
  14. #or reverse order of bits:
  15. #newinit += s << i
  16. return newinit
  17.  
  18. def log_2_up(r):
  19. l=0
  20. s=r-1
  21. while s > 0:
  22. s = s >> 1
  23. l += 1
  24. return l
  25.  
  26. def generator(a,n):
  27. e = encoding(n+a)
  28. a = ((((n+a) >> (log_2_up(n+a)-95)) ^ e) + a) & 340282366920938463463374607431768211455
  29. return [a,e]
  30.  
  31.  
  32. for i in range(10):
  33. #while True:
  34. z = generator(a,n)
  35. a = z[0]
  36. print(z[0])
  37.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement