Questions tagged [fibonacci-sequence]

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.

163 questions
Filter by
Sorted by
Tagged with
236 views

Testing Fibonacci conjecture

The sequence of Fibonacci numbers is defined as F1 = 1, Fn = Fn−2 + Fn−1. It has been conjectured that for any Fibonacci number F, F2 + 41 is composite. ... [T]ask is to either prove the ...
191 views

Project Euler #2: sum of even Fibonacci numbers, using generators

I am currently working on Project Euler problem #2 which requires you to print the sum of all even fibonacci numbers below 4 million. I just recently learned about generators and from my ...
843 views

Finding the nth element of generalized Fibonacci sequences

I solved the Fibonacci Golf problem on checkio.org: The Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21... This is not ...
116 views

Sequence generation problem - Fibonacci

Below is the representation and user interface fib_sequence for generating a Fibonacci sequence: ...
210 views

Sequence processing problems

Problem 1: Sum the even numbers for the first n fibonacci numbers Solution: ...
1k views

Memoization of Fibonacci using generic Int => Int helper

I'm trying to understand memoization using Scala. I took the Fibonacci sequence as an example because of the high cost of recursively computing numbers in the sequence without memoization. ...
5k views

2k views

Another even Fibonacci numbers implementation

This is intended as something of a comparative study. I'm including not just one, but two separate implementations of code to implement the Project Euler problem to sum the even Fibonacci numbers up ...
1k views

Four algorithms to find the Nth Fibonacci number

I'm implementing some basic algorithms in Go as an introductory exercise. Here are four different algorithms to find the Nth Fibonacci number. I'm looking for general feedback, but I'm specially ...
337 views

...
1k views

Recursive Fibonacci with Generic delegates

Here is a fast recursive Fibonacci-like for loop. How can it be more readable, and is it possible remove TArgs? ...
2k views

Print routes on the stairway when only 1 or 2 steps are possible

Given a staircase with N steps, you can go up with 1 or 2 steps each time. Output all possible ways you go from bottom to top. I'm looking for code review, best practices, optimizations etc. ...
2k views

Fibonacci series, topdown and bottom up approaches, stairway climbing

I have solved fibonacci series and then used the topdown and bottom up approaches to solve it. Also I have included the stairway climbing question as follows "You are climbing a stair case. Each time ...
4k views

Is this Fibonacci function right?

Is this a correct method of Fibonacci with recursion? ...
2k views

More efficient solution for Project Euler #2 (sum of Fibonacci numbers under 4 million)

I would like to get some feedback on my code. I am starting to program after doing a few online Python courses. Would you be able to help me by following my track of thinking and then pinpointing ...
4k views

Fibonacci sequence in C

I'm very new to C, so pointing out better ways of doing things, errors, bad practices, etc would be optimal at this stage. Code on GitHub ...
16k views

Project Euler Question #2: Sum of even Fibonacci numbers under 4 million

The question is: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, ...
164 views

Optimize RecursionArray interface

I created a class a while ago that I named a "Recursion Array". It is a way to create dynamically memoized sequences such as the Fibonacci sequence or the factorial numbers sequences. The concept is ...
453 views

Better way of calculating Project Euler #2 (Fibonacci sequence)

Even Fibonacci numbers Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3,...
825 views

Maintaining the Single Responsibility Principle with Project Euler #2

This is my solution to Project Euler problem 2: By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. The class ...