recaman: Recaman Sequence

Description Usage Arguments Value References Examples

View source: R/recaman_sequence.R

Description

Always go back. If you can't go back, go forward.

Usage

1

Arguments

n

The number of terms of the sequence to generate.

plot

Logical. Should the sequence be plotted with semicircles?

Value

The Recamán sequence.

References

This sequence in the On-Line Encyclopedia of Integer Sequences: A005132.

The Numberphile video featuring Alex Bellos and Brady Haran: The Slightly Spooky Recaman Sequence.

Examples

1
r <- recaman(100, TRUE)

BastiHz/numberphile documentation built on Oct. 12, 2020, 6:03 p.m.