Skip to main content

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.

2 votes
3 answers
2k views

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 ...
Charles Henington's user avatar
1 vote
3 answers
198 views

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 ...
Droid's user avatar
  • 119
7 votes
3 answers
2k views

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 ...
Justin Cheng's user avatar
2 votes
1 answer
134 views

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 ...
DisplayName's user avatar
0 votes
1 answer
148 views

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, ...
Rahul Shivsharan's user avatar
-3 votes
1 answer
218 views

Calculate the sum of even Fibonacci numbers

This is my solution for problem 2 of Project Euler using Python: ...
Amir Motefaker's user avatar
1 vote
3 answers
202 views

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 ...
Rahul Shivsharan's user avatar
5 votes
0 answers
185 views

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 ...
Ξέ��η Γήινος's user avatar
1 vote
1 answer
830 views

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 ...
NPN328's user avatar
  • 771
1 vote
1 answer
228 views

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\$ ...
Ξένη Γήινος's user avatar
2 votes
1 answer
301 views

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 ...
Ξένη Γήινος's user avatar
3 votes
1 answer
113 views

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 ...
William Bradley's user avatar
2 votes
1 answer
486 views

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 ...
Lady Be Good's user avatar
1 vote
1 answer
84 views

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 ...
fluffyyboii's user avatar
1 vote
3 answers
165 views

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? ...
Malemna's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
13