Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save crypto-scambaiter/8c924476a6a415575aadb80cfde7faa7 to your computer and use it in GitHub Desktop.
Save crypto-scambaiter/8c924476a6a415575aadb80cfde7faa7 to your computer and use it in GitHub Desktop.
from math import log
from random import getrandbits
from collatz_traj_seeds import seeds_by_trajectory
up_to_down_ratio = log(2.0) / log(1.5)
traj = '110'
n_ups = 2
n_downs = 1
for i in range(97):
if n_ups / (n_downs+1) > up_to_down_ratio:
if getrandbits(1):
n_ups += 1
traj += '1'
else:
n_downs += 1
traj += '0'
else:
n_ups += 1
traj += '1'
k, t = seeds_by_trajectory(traj)
print('Trajectory', traj, ' start =', k, ' end =', t, ' pick any r = 1,2,3,...')
seed_min = k.a + k.b
print('Smallest seed', seed_min, 'binary', bin(seed_min))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment