<jupyter_start><jupyter_text>Collatz MapperThe idea is to make a particular visual representation of the [Collatz Conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture "Collatz Conjecture") where we consider a generalized version of the conjecture: $a n + b$ and divisor $d$. First, Numpy is loaded and some useful functions are loaded from the file `collatz.py`.<jupyter_code>import numpy as np
from collatz import collatz_mapper, collatz_plotter
amax = 16
bmax = 16
div = 2
nlim = 20

collatz_map = collatz_mapper(amax, bmax, div, nlim)

collatz_plotter(collatz_map, div)<jupyter_output><empty_output><jupyter_text>Load a map<jupyter_code>#Load Collatz Map
collatz_map = np.loadtxt('maps/collatz_map_a64_b64_div3.colmap')
#Plotting the map
collatz_plotter(collatz_map, 3)
#If map being loaded was made using C file, it should be transposed
collatz_plotter(collatz_map.transpose(), 3)<jupyter_output><empty_output><jupyter_text>Save a map to a text file<jupyter_code>#Save collatz map to file
filename = 'collatz_map_a'+str(amax)+'_b'+str(bmax)+'_div'+str(div)+'.colmap'
with open(filename, 'w') as file:
    for row in range(2*amax):
        for column in range(2*bmax):
            file.write(str(collatz_map[row,column])+'\t')
        file.write('\n')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10913312693498452, 'fraction_numerical': 0.01238390092879257, 'mean_word_length': 6.143646408839779, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '54500', 'license': 'MIT', 'n_tokens_mistral': 477, 'n_tokens_neox': 471, 'n_words': 121, 'path': 'Collatz Mapper Notebook - V1.ipynb', 'repo_name': 'danj7/Collatz-Mapper', 'size': '1292'}