fibonacci_binet: Estimate the nth Fibonacci number using Binet's Formula

Description Usage Arguments Details Value Examples

View source: R/misc.R

Description

Estimate the nth Fibonacci number using Binet's Formula

Usage

1

Arguments

n

which Fibonacci number to estimate

Details

Binets' Formula estimates the nth Fibonacci number using the Golden Ratio

F_n = (φ^n - (-φ)^{-n})/√{5}

where φ is the Golden Ratio

φ = (1 + √{5})/2 ~ 1.618034

Value

the nth Fibonacci number

Examples

1
2
fibonacci_binet(1:6)
# 1 1 2 3 5 8

jonocarroll/ggshape documentation built on July 11, 2017, 12:41 a.m.