Colourised Collatz Coral; derived from this original by Edmund Harriss
Functions related to the Collatz/Syracuse/3N+1 problem, implemented in R.
To install the latest from github, with devtools;
Rscript -e 'devtools::install_github("Skenvy/Collatz", subdir="R")'To install a specific GitHub release's tarball (all R-v* tagged releases include a collatz_*.tar.gz, simply copy the below and change the example version from 1.0.0 to whichever version you want);
VER=1.0.0 && curl -L https://github.com/Skenvy/Collatz/releases/download/R-v${VER}/collatz_${VER}.tar.gz > collatz_${VER}.tar.gz && Rscript -e "install.packages('collatz_${VER}.tar.gz', repos=NULL, type='source')"To install the latest from CRAN;
Rscript -e 'install.packages("collatz")'Provides the basic functionality to interact with the Collatz conjecture.
The parameterisation uses the same (P,a,b) notation as Conway's generalisations.
Besides the function and reverse function, there is also functionality to retrieve the hailstone sequence, the "stopping time"/"total stopping time", or tree-graph.
The only restriction placed on parameters is that both P and a can't be 0.
On a debian system, this should be most of the required setup.
git clone https://github.com/Skenvy/Collatz.git && cd Collatz/R && sudo make setup_debian && make setup && make setup_librariesmake docs_localto start a local server to browse the docs generated by roxygen2, pkgdown, covr, Rd2pdf and TinyTex, served by servr.make full_testwill verify the integrity of the package after passing the tests, as passing the tests is a lower threshold than package structure.
