Fibonacci Calculator Formula

Understand the math behind the fibonacci calculator. Each variable explained with a worked example.

Formulas Used

Fib N

fib_n = round(pow((1 + sqrt(5)) / 2, n) / sqrt(5))

Golden Ratio

golden_ratio = (1 + sqrt(5)) / 2

Fib N Minus 1

fib_n_minus_1 = n >= 1 ? round(pow((1 + sqrt(5)) / 2, n - 1) / sqrt(5)) : 0

Ratio

ratio = n >= 2 ? round(pow((1 + sqrt(5)) / 2, n) / sqrt(5)) / round(pow((1 + sqrt(5)) / 2, n - 1) / sqrt(5)) : 0

Variables

VariableDescriptionDefault
nPosition (n)10

How It Works

Fibonacci Sequence

Definition

F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2)

Sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Binet's Formula

F(n) = (phi^n - psi^n) / sqrt(5)

where phi = (1 + sqrt(5))/2 (golden ratio) and psi = (1 - sqrt(5))/2.

For large n, psi^n approaches 0, so F(n) ≈ phi^n / sqrt(5).

Golden Ratio

As n grows, F(n)/F(n-1) approaches the golden ratio phi ≈ 1.6180339887.

Worked Example

Find the 10th Fibonacci number.

n = 10
  1. 01F(10) = phi^10 / √5
  2. 02= 1.61803^10 / 2.23607
  3. 03≈ 122.992 / 2.236
  4. 04≈ 55
  5. 05Sequence up to F(10): 0,1,1,2,3,5,8,13,21,34,55

Frequently Asked Questions

What is the Fibonacci sequence?

The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones: 0, 1, 1, 2, 3, 5, 8, 13, 21, ...

What is the golden ratio?

The golden ratio (phi ≈ 1.618) is the limit of the ratio of consecutive Fibonacci numbers. It appears in art, architecture, and nature.

Where do Fibonacci numbers appear in nature?

Fibonacci numbers appear in flower petals, seed spirals in sunflowers, pinecones, pineapples, and branching patterns in trees.

Ready to run the numbers?

Open Fibonacci Calculator