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

Description Usage Arguments Details Value Examples

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 May 12, 2019, 1:05 p.m.