forest_fire: Forest Fire

Description Usage Arguments References Examples

View source: R/forest_fire.R

Description

Sequence of positive integers where each is chosen to be as small as possible subject to the condition that no three terms a(j), a(j+k), a(j+2k) (for any j and k) form an arithmetic progression.

Usage

1

Arguments

n

The number of terms of the sequence to generate.

References

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

The Numberphile video featuring Neil Sloane and Brady Haran: Amazing Graphs II (including Star Wars) (skip to 3:37).

Examples

1
2
3
ff <- forest_fire(5000)
fire_colors <- sample(heat.colors(10), length(ff), replace = TRUE)
plot(ff, pch = 16, col = adjustcolor(fire_colors, alpha.f = 1/3))

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