Skip to the content.

Fibonacci

Fibonacci numbers and sequences.

npm npm downloads CI codecov

Compute the Fibonacci Succession and NTH Fibonacci Number.

Install

npm install @ultirequiem/fibonacci

Usage

ESM only, types included: the same import works in Node.js, Bun and browsers.

import {
  fibonacci,
  fibonacciSequence,
} from "@ultirequiem/fibonacci";

fibonacci(10); //=> 55

fibonacci(5); //=> 5

// First 10 Fibonacci Numbers
for (const fiboNumber of fibonacciSequence(9)) {
  console.log(fiboNumber);
}

console.log(`My favorites numbers are ${[...fibonacciSequence(3)]}.`);
//=> "My favorites numbers are 0,1,1,2."

Usage Example

Support

Open an Issue, I will check it as soon as possible πŸ‘€

If you want to hurry me up a bit send me a tweet πŸ˜†

Don’t forget to star the repo ⭐

Authors

Eliaz Bobadilla - Creator and Maintainer πŸ’ͺ

See also the full list of contributors who participated in this project ✨

Versioning

We use Semantic Versioning. For the versions available, see the tags 🏷️

Licence

Licensed under the MIT License πŸ“„