Languages
[Edit]
EN

TypeScript - Fibonacci sequence / number

3 points
Created by:
Welsh
902

Fibonacci numbers can be computed in three ways:

  1. with an iterative algorithm,
  2. with a recursive algorithm,
  3. with Binet's formula.

Note: presented implementations calculate Fibonacci numbers from 0.

 

1. Iterative algorithm example

Edit

Output:

 

2. Recursive algorithm example

Edit

Output:

 

3. Binet's formula example

Edit

Output:

 

See also

Edit
  1. JavaScript - Fibonacci sequence / number

References

Edit
  1. Binet's Fibonacci number formula - Wikipedia
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join