Hailstone Sequences

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Getting Started

After following the "Get Started + Install" guide;

library(collatz)
# Optionally
library(gmp)

hailstone_sequence

Compute a hailstone sequence, which defaults to the total stopping time;

hailstone_sequence(5)

Or only compute down to the regular stopping time;

hailstone_sequence(5, total_stopping_time=FALSE)

Remove verbose messaging;

hailstone_sequence(5, verbose=FALSE)

It will also stop on finding a cycle;

hailstone_sequence(-56)

And can be parameterised;

hailstone_sequence(3, -1, 3, 1)


Try the collatz package in your browser

Any scripts or data that you put into this service are public.

collatz documentation built on Sept. 5, 2022, 9:06 a.m.