--- title: "Hailstone Sequences" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Hailstone Sequences} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## Getting Started After following the ["Get Started + Install"](https://skenvy.github.io/Collatz/R/articles/collatz.html#install) guide; ```{r setup, message = FALSE} library(collatz) # Optionally library(gmp) ``` ## hailstone_sequence Compute a hailstone sequence, which defaults to the total stopping time; ```{r} hailstone_sequence(5) ``` Or only compute down to the regular stopping time; ```{r} hailstone_sequence(5, total_stopping_time=FALSE) ``` Remove verbose messaging; ```{r} hailstone_sequence(5, verbose=FALSE) ``` It will also stop on finding a cycle; ```{r} hailstone_sequence(-56) ``` And can be parameterised; ```{r} hailstone_sequence(3, -1, 3, 1) ```