prime_parallelograms: Prime Parallelograms

Description Usage Arguments Value References Examples

View source: R/prime_parallelograms.R

Description

Take a prime number, convert it to binary, reverse it, convert it back to decimal, and then substract it from the original prime number.

Usage

1

Arguments

n

The upper limit of the region that is searched for primes.

plot

Logical. Should the parallelograms be plotted?

Value

A data frame with columns for the primes, the result of the binary reversal and substraction, and the indices of the primes.

References

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

The Numberphile video featuring Neil Sloane and Brady Haran: Amazing Graphs (skip to 7:47).

Examples

1
2
pp <- prime_parallelograms(10000)
plot(pp$i, pp$y, pch = 20, cex = 0.3)

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