Most voted "fibonnaci" questions
The Fibonacci sequence consists of a sequence of numbers, such that, by defining the first two numbers of the sequence as 0 and 1, the following numbers will be obtained by summing their two predecessors. Therefore, the numbers are: 0.1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181...
Learn more…15 questions
Sort by count of
-
14
votes2
answers4638
viewsFibonacci sequence
I need to perform an exercise to show the Fibonacci sequence up to the 100th element, I need to create a Fibonacci function that should receive the element index and the function will calculate the…
-
13
votes2
answers668
viewsWhy is a Fibonacci faster in Java than in C?
Not exactly like this, but I noticed that when the function needs more time to compute Fibonacci, Java actually does better than C. Here are the implementations: C: #include<stdio.h> unsigned…
-
10
votes5
answers844
viewsWhat is the shortest and most performative way to write Fibonnaci in Javascript?
Javascript is a language that allows you to write the same thing in several different ways. The best answer should describe the syntax resources used to reach the goal which is a shorter function…
-
4
votes1
answer430
viewsHow do you find the term X in the Fibonacci sequence?
I have to do a C# program that gets a number X which will be the term of the sequence and print it on the screen.
-
3
votes1
answer156
viewsConditional Operations Error in R
I am programming a simple recursive algorithm to compute the Fibonacci sequence in R, as I do in C. Follow the same below: fibonacci <- function (n) { if (n == 1L) return (0L) else if (n == 2L ||…
-
2
votes1
answer527
viewsRuntimeerror: maximum number of recursive calls exceeded - python
fibonacci_cache = {} def fibonacci(n): if n in fibonacci_cache: return fibonacci_cache[n] if n==1: value=1 elif n==2: value=1 elif n>2: value=fibonacci(n-1) + fibonacci(n-2)…
-
2
votes6
answers7179
viewsSimple Solution for Fibonacci Algorithm
I have this statement in hand: Given the Fibonacci sequence 1 1 2 3 5 8 13 ... n, write an algorithm to generate the sequence to the nth term, which must be provided by the user. For example, if the…
-
1
votes1
answer577
viewsHow to make algorithm to calculate efficient (not exponential) recursive Fibonacci sequence?
I’m studying recursion, and I wanted to find a way to make a recursive algorithm for efficient Fibonacci sequence, where the algorithm is not exponential. How will I save the value of subproblems??…
-
0
votes1
answer284
viewsInitial end term of the Fibonacci sequence (closed interval)
I have to make a list of exercises in C and Java, but I could not understand the logic in this exercise. Could someone help? Ask the user for the initial and final Fibonacci sequence term (closed…
-
0
votes1
answer652
viewsFraction sequence with Fibonacci and primes
h. Ask the user for the amount of terms he wants and print the sequence below and the sum of terms. 1 + 1 + 2 + 3 + 5 + 8 +… 2 3 5 7 11 13 * above Fibonacci sequence and below Primes sequence. I…
-
0
votes0
answers32
viewsDoubt about Fibonacci series
Why didn’t my code print the first 300 numbers in the Fibonacci series and start finding negative numbers? What’s the problem with this code? Because he only goes up to 92? final int ARRAY_SIZE =…
-
-1
votes2
answers92
viewsReturn the Fibonnaci elements from the term passed to the first
I have made the return of some specific elements already, but I am trying to return up to the first. In the code below I returned a certain element, as I create from now until the first, until the…
-
-1
votes1
answer224
viewsHow to print the first 12 terms of the Fibonacci sequence in reverse in Pascal?
How to print the first 12 terms of the Fibonacci sequence in reverse in Pascal? Instead of 1 to 12, 12 to 1 program Exercicio_31; var V:array[3..12]of integer;I,termo1,termo2,novoTermo:integer;…
-
-2
votes1
answer117
viewsHow to make Fibonacci sequence through matrix?
I’m developing a C algorithm that displays a Fibonacci sequence on the screen, but first I built a spreadsheet in Excel to understand how this sequence works and realized that it is a 3 column…
-
-3
votes1
answer167
viewsShow F(n) of the Algorithm sequence of Fibonacci
I need to know the last term of the Fibonacci sequence, I’ve done it to show all the terms, but I need you to show me the last I’m using the Visualg Algoritmo "Fibonacci" Var v1, v2, v3, limite,…