Top "Fibonacci" questions

The Fibonacci sequence is the sequence defined by F(0) = 0, F(1) = 1, F(n + 2) = F(n) + F(n + 1). The first few terms are 0, 1, 1, 2, 3, 5, 8.

Fibonacci sequence in Ruby (recursion)

I'm trying to implement the following function, but it keeps giving me the stack level too deep (SystemStackError) error. Any …

ruby recursion fibonacci
In the Fibonacci sequence, is fib(0) 0 or 1 ?

I'm doing a task in a subject were fib(0) is defined to = 1. But that can't be right? fib(0) is 0? Program …

fibonacci
How does the fibonacci recursive function "work"?

I'm new to Javascript and was reading up on it, when I came to a chapter that described function recursion. …

recursion fibonacci
Why is the complexity of computing the Fibonacci series 2^n and not n^2?

I am trying to find complexity of Fibonacci series using a recursion tree and concluded height of tree = O(n) …

algorithm recursion big-o fibonacci
Finding the sum of even valued terms in Fibonacci sequence

#!/usr/bin/python2 """ Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting …

python sum fibonacci
Print a string of fibonacci recursively in C#

Can that be done with no while loops? static void Main(string[] args) { Console.WriteLine("Please enter a number"); int …

c# recursion fibonacci
Fast Fibonacci recursion

I'm trying to recall an algorithm on Fibonacci recursion. The following: public int fibonacci(int n) { if(n == 0) return 0; else …

algorithm recursion fibonacci
Generating Fibonacci numbers in Haskell?

In Haskell, how can I generate Fibonacci numbers based on the property that the nth Fibonacci number is equal to …

haskell fibonacci
Generating a list of EVEN numbers in Python

Basically I need help in generating even numbers from a list that I have created in Python: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, ...] I have tried …

python numbers fibonacci
Test if a number is fibonacci

I know how to make the list of the Fibonacci numbers, but i don't know how can i test if …

c++ algorithm math testing fibonacci