Created
October 8, 2018 03:40
-
-
Save crypto-scambaiter/8c924476a6a415575aadb80cfde7faa7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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