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.

NumberFormatException: Infinite or NaN

I have a method that takes n and returns nth Fibonacci number. Inside the method implementation I use BigDecimal to …

java fibonacci numberformatexception
Tail Recursion Fibonacci

How do I implement a recursive Fibonacci function with no loops running in O(n)?

python big-o fibonacci
Returning Nth Fibonacci number the sequence?

I have a question on my homework for class and I need to know how to return nth number of …

c# iteration fibonacci
Fibonacci One-Liner

I'm trying to solve questions from Project Euler in Ruby one-liners, and I'm curious if there's a more elegant solution …

ruby fibonacci
Why are Fibonacci numbers significant in computer science?

Fibonacci numbers have become a popular introduction to recursion for Computer Science students and there's a strong argument that they …

algorithm math data-structures fibonacci
Generate a sequence of Fibonacci number in Scala

def fibSeq(n: Int): List[Int] = { var ret = scala.collection.mutable.ListBuffer[Int](1, 2) while (ret(ret.length - 1) < n) { …

scala sequence list-comprehension fibonacci
Can a Fibonacci function be written to execute in O(1) time?

So, we see a lot of fibonacci questions. I, personally, hate them. A lot. More than a lot. I thought …

algorithm floating-point time-complexity fibonacci
Assembly Language (x86): How to create a loop to calculate Fibonacci sequence

I am programming assembly language (x86) in MASM using Visual Studio 2013 Ultimate. I am trying to use an array to …

assembly x86 masm fibonacci irvine32
a recursive Fibonacci function in Clojure

I'm a newcomer to clojure who wanted to see what all the fuss is about. Figuring the best way to …

recursion clojure fibonacci
An inverse Fibonacci algorithm?

There are dozens of ways of computing F(n) for an arbitrary n, many of which have great runtime and …

algorithm math fibonacci