Documentation

numlib::fibonacci

Fibonacci numbers

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

numlib::fibonacci(n)

Description

numlib::fibonacci(n) returns the n-th Fibonacci number.

If n is a nonnegative integer then numlib::fibonacci(n) returns the n-th Fibonacci number.

numlib::fibonacci returns an error if the argument evaluates to a number of wrong type. numlib::fibonacci returns the unevaluated function call if n does not evaluate to a number.

Examples

Example 1

We compute the 201st Fibonnacci number:

numlib::fibonacci(201)

Parameters

n

A nonnegative integer

Return Values

Nonnegative integer, or the function call with its arguments evaluated.

Algorithms

The n-th Fibonacci number Fn is defined by the recursion formula F0 = 0, F1 = 1, and Fn + 2 = Fn + Fn + 1.

numlib::fibonacci uses quadratic recursion formulas.

Was this topic helpful?