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.
195 questions
2votes
3answers
2kviews
Fibonacci Sequence Generator generates 1 million numbers
A FibonacciSequenceGenerator in C# looking for speed improvements. Currently generates 1 million numbers in 25.6 seconds. We must use BigInteger because the ...
1vote
3answers
206views
fibonacci sequence generator
I have a piece of code that attempts to reduce the work and span in making a Fibonacci sequence. My approach is to parallelize the code as much as possible, along with doing matrix multiplication and ...
7votes
3answers
2kviews
Find the n-th Fibonacci number in O(log n) time
I was reading this website. It mentioned how to use matrix exponents to find the n-th Fibonacci number in O(log n) time. I tried implementing it Python along with a fast exponent algorithm. I'm not ...
2votes
1answer
134views
Fibonacci calculator
I'm trying to learn Rust and for this reason I'm reading the Rust Book. It contains the following exercise: Generate the nth Fibonacci number. Here's my take. Note I'm only using material from ...
0votes
1answer
148views
Can I optimize my implementation of generating Fibonacci series using recursion?
My function accepts a number, which generates total Fibonacci numbers. I am using recursion. Please follow the code below, ...
-3votes
1answer
218views
Calculate the sum of even Fibonacci numbers
This is my solution for problem 2 of Project Euler using Python: ...
1vote
3answers
203views
Printing the first n numbers of the Fibonacci sequence
I have written a code below for printing the first n fibonacci numbers, the code is as follows ...
5votes
0answers
185views
A Python 3 script that generates art using matplotlib
I am always super interested in both science and art, science and art are two different ways to describe the objective reality, they are two sides of the same coin, in many areas they overlap, and ...
1vote
1answer
830views
Functional Fibonacci in OCaml
I'm very new to OCaml, and as an exercise I decided to implement the nth Fibonacci algorithm (return a specific Fibonacci number, given an index) in different ways, using what I've learned so far. I ...
1vote
1answer
228views
JavaScript function that generates Fibonacci like sequences of given order
Generalizations of Fibonacci numbers Fibonacci numbers of higher order A Fibonacci sequence of order \$n\$ is an integer sequence in which each sequence element is the sum of the previous \$n\$ ...
2votes
1answer
301views
Python functions that calculate first n terms of a given order of Fibonacci sequences
I have written two functions that calculate the first n terms of a given order o of Fibonacci sequence, and return the result as ...
3votes
1answer
113views
Iterative Fibonacci number generator in Kotlin
I have very limited experience in Java and slightly more in C# (just doing Advent of Code problems last month), so I'm not familiar with how to write idiomatic Kotlin. This class implements an ...
2votes
1answer
486views
Project Euler Problem #755
As the title indicates this is one of the last most problems of Project Euler. The problem is straightforward. However, similar to the rest of the Euler Project problems either ...
1vote
1answer
84views
Generating the N-bonacci numbers
I'm new to Haskell, and this is one of the more interesting programs I've made with it so far. I understand there are already solutions to this problem that use much less code, but to me this one ...
1vote
3answers
165views
Fibonacci generator python implementation
I wrote this code for a fibonacci sequence generator. Can anyone tell me whether my code is designed well? if not, why? ...