look_and_say: Look-and-Say Sequence

Description Usage Arguments Value References Examples

View source: R/look_and_say.R

Description

A sequence which describes its previous term.

Usage

1
look_and_say(n = 1, seed = 1, return_all = FALSE)

Arguments

n

The number of iteration steps.

seed

The starting sequence.

return_all

Logical. Should all steps be returned? Defaults to TRUE.

Value

The final iteration of the sequence as a vector if return_all is FALSE, otherwise a list of all steps of the sequence.

References

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

The Numberphile video featuring John Conway and Brady Haran: Look-and-Say Numbers (feat John Conway).

Examples

1
look_and_say(seed = 1, n = 7, return_all = TRUE)

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