collatz

Enabling experimenting with functions related to or involved in the Collatz conjecture.


Keywords
Collatz, Ulam, Kakutani's, Thwaites, Hasse's, Syracus
License
Apache-2.0
Install
pip install collatz==1.0.1

Documentation

Banner Image, Collatz Coral

Colourised Collatz Coral; derived from this original by Edmund Harriss


Of all the open problems in mathematics, the Collatz Conjecture / 3N+1 problem [*] is infamously probably the most disproportionately difficult to solve compared to how incredibly simple it is to state. The simplest form of the question is, for every positive integer, if we recursively halve any even integer, and alternatively multiply by 3 and add 1 for any odd integer, are we guaranteed to eventually end up with a value of 1.

This project aims to provide as similar an interface and experience as possible, across several languages, for interacting with basic functionality related to the Collatz conjecture. The initial focus is a breadth first approach, that tries to provide a parameterisable hailstone and tree-graphing function in every implementation that has been committed to. After these are complete, the focus will shift to providing LaTeX notes on particular approaches to solving it, which have the potential to inform what additional features and functionality will likely be added. Although you can always raise a feature request, there's no guarantee as to how it will be prioritised.

The list of implementations, where the externally hosted package lives, where the GitHub hosted pages lives, and whether there is an internal package hosted on GitHub or not, are listed below.

Badges

CII Best Practices Go Reference Go Report Card CRAN Version

Implementations

Code External Pkg GitHub Pages Internal Pkg
C# #TODO #TODO #TODO
Gleam #TODO #TODO N/A
Go pkg.go.dev GoDoc+Cover N/A
Java mvn-central Site+JavaDoc mvn-gh
JavaScript npm TSDoc+TypeDoc npm-gh
Julia juliahub Documenter N/A
LaTeX N/A #TODO N/A
Python pypi Sphinx+MyST N/A
R CRAN roxy+pkgd+covr+PDF N/A
Ruby RubyGems RDoc gems-gh
Rust #TODO #TODO N/A

Versioned Functionality

  • "optionally" refers to the ability to provide parameterisation at will, i.e. you should be able to choose to provide it or not to. It does not mean that the parameterisability as a feature is optional to implement.

V0: Basic: Function and Reverse Function

  • The function, optionally parameterisable.
  • The reverse function, optionally parameterisable.

V1: Core: Hailstone and Treegraph, parameterisable and accepting arbitrary integers.

  • The function, optionally parameterisable, accepts arbitrary integers.
  • The reverse function, optionally parameterisable, accepts arbitrary integers.
  • Hailstone sequences, with optional max stopping time, parameterisability, "stopping mode" (total stop or stop), and inclusion of verbose control sequence flags to describe the output.
  • Stopping time, with optional max stopping time, parameterisability, "stopping mode" (total stop or stop).
  • Tree graphs (hailstone equivalent using the reverse function), with optional parameterisability, and not optional "maximum orbit".

V2:?