balanced_ternary: Balanced Ternary

Description Usage Arguments References Examples

View source: R/balanced_ternary.R

Description

Write a number n in base 3, substitute every 2 with a -1, then convert to decimal.

Usage

1

Arguments

n

The number of terms of the sequence to generate.

References

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

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

Examples

1
2
bt <- balanced_ternary(200)
plot(bt)

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