Skip to content

Python library for the analysis of the Collatz problem, providing notebooks, scripts and common modules.

License

Notifications You must be signed in to change notification settings

c4ristian/collatz

Repository files navigation

Collatz Python Library

What is it?

The Collatz conjecture is an unsolved number theory problem. This Python library provides tools to analyse it from different perspectives. The project has contributed to multiple scientific publications:

Main Features

The library provides the following modules:

  • automata - automatons that model certain aspects of the Collatz problem
  • commons - common functions for creating and analysing Collatz sequences
  • cycles - functions to analyse cycles in Collatz sequences
  • generator - functions to generate Collatz sequences and related features
  • graph - functions to create and analyse Collatz graphs

The project furthermore offers jupyter notebooks and scripts for data exports. The notebooks are stored as markdown files to support efficient versioning in git. The synchronisation between markdown files and ipynb files is handled by the framework jupytext (for further instructions see below).

Where to get it

The source code is currently hosted on GitHub at: https://github.com/c4ristian/collatz

Setup

conda env create -f environment.yml
conda activate collatz

Run Tests

pytest

Code Coverage

pytest --cov

Code Quality

pylint FILENAME.py

Run script

python FILENAME.py

Jupyter

Sync Notebooks

jupytext --sync notebooks/*.md
jupytext --sync notebooks/*/*.md

Pair Notebook

jupytext --set-formats ipynb,md notebooks/NOTEBOOK.ipynb

Install Kernel

python -m ipykernel install --user --name=collatz

Run Notebooks

jupyter notebook --notebook-dir="./notebooks"

License

Apache 2.0

Contact us

[email protected]

About

Python library for the analysis of the Collatz problem, providing notebooks, scripts and common modules.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages