ulam_spiral: Ulam Spiral

Description Usage Arguments References Examples

View source: R/ulam_spiral.R

Description

Write the numbers from 1 to n in a square spiral and mark all primes.

Usage

1
ulam_spiral(sidelength)

Arguments

sidelength

The side length of the spiral.

References

The Numberphile video featuring James Grime and Brady Haran: Prime Spirals.

Examples

1
2
us <- ulam_spiral(100)
grid::grid.raster(!us, interpolate = FALSE)

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