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

A FibonacciSequenceGenerator in C# looking for speed improvements. Currently generates 1 million numbers in 25.6 seconds. We must use BigInteger because the ...
Short Int's user avatar
  • 762
1 vote
2 answers
342 views

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

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
149 views

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
177 views

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
253 views

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

I have written a code below for printing the first n fibonacci numbers, the code is as follows ...
Rahul Shivsharan's user avatar
7 votes
1 answer
242 views

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
3 votes
1 answer
884 views

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
  • 791
1 vote
1 answer
258 views

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
328 views

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
134 views

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
518 views

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
105 views

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
233 views

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