Fibonacci
Returns the n
th Fibonacci number.
Syntax
-
Fibonacci(n)
-
n
is a non-negative integer
-
Description
If n
is a non-negative integer, then Fibonacci(n)
is the n
th Fibonacci number. The Fibonacci numbers F(n) are defined recursively by
⎧ 1 if n = 0 F(n) = ⎨ 1 if n = 1 ⎩ F(n − 1) + F(n − 2) otherwise.
Examples
SequenceVector(20) @ Fibonacci
(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765)
filter(SequenceVector(50) @ Fibonacci, IsPrime)
(2, 3, 5, 13, 89, 233, 1597, 28657, 514229, 433494437, 2971215073)
∑(1/Fibonacci(n), n, 1, 100)
3.35988566624
∑(1/(1 + Fibonacci(2⋅n + 1)), n, 0, 100)
1.11803398875 (=√5/2)