Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "calculating...")
- while j < len(primes):
- k = j
- while k < len(primes):
- #use the smallest of the two
- p = a*b
- if a < b or a == b:
- i = d(floor(a/2))
- r = (p-(((abs(((((p)-(9**i)-9)+1))-((((9**i)-(p)-9)-2)))-p+1)-p)%p))%a
- else:
- i = d(floor(b/2))
- r = (p-(((abs(((((p)-(9**i)-9)+1))-((((9**i)-(p)-9)-2)))-p+1)-p)%p))%b
- if r == 0:
- success = success+1
- else:
- fail = fail+1
- results.append([a, b])
- k = k + 1
- count = count + 1 #keep a running total of all iterations
- print(f"success: {success}, fail: {fail}, success-to-failure ratio: {success/fail}")
- if k < len(primes):
- a = primes[k]
- else:
- pass
- j = j + 1
- if j < len(primes):
- b = primes[j]
- else:
- pass
- print("done!")
- print(" - final results -")
- print(f"success: {success}, fail: {fail}, success-to-failure ratio: {success/fail}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement