How are we able to calculate specific numbers in the Fibonacci Sequence? I was reading up on the Fi

Marquis Cooper

Marquis Cooper

Answered question

2022-06-03

How are we able to calculate specific numbers in the Fibonacci Sequence?
I was reading up on the Fibonacci Sequence, {1,1,2,3,5,8,13,....} when I've noticed some were able to calculate specific numbers. So far I've only figured out creating an array and counting to the value, which is incredibly simple, but I reckon I can't find any formula for calculating a Fibonacci number based on it's position.
Is there a way to do this?

Answer & Explanation

Heidi Rosales

Heidi Rosales

Beginner2022-06-04Added 2 answers

A closed-form function called "Binet's formula":
F ( n ) = φ n ( 1 φ ) n 5
This is based on the Golden Ratio.
Kallie Arroyo

Kallie Arroyo

Beginner2022-06-05Added 1 answers

Also you can use the matrix equation for Fibonacci numbers:
( 1 1 1 0 ) n = ( F n + 1 F n F n F n 1 )
To calculate n-th power of the matrix you can use exponentiation by squaring algorithm.
This approach could also be generalized on the case of arbitrary sequence with linear recurrence relation.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?