Questions tagged as 'fibonnaci'

1
answer

Fibonacci Sequence

I need to perform an exercise to show the Fibonacci sequence up to the 100th element, I must create a Fibonacci function that should receive the index of the element and the function will calculate the corresponding number of that index. I'm...
asked by 15.12.2015 / 04:01
5
answers

What is the shortest and most performative way of writing 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 features used to arrive at the goal which is a shortest possible function and a very performative one regar...
asked by 20.03.2014 / 17:27
1
answer

How to find the term X of the Fibonacci sequence?

I have to make a program in C # that receives a% number of% that will be the term of the sequence and print it on the screen.     
asked by 16.03.2015 / 00:23
1
answer

Error in Conditional Operations in Language R

I am programming a simple recursive algorithm to calculate the Fibonacci sequence in R, just as I do in C. It follows the same thing below: fibonacci <- function (n) { if (n == 1L) return (0L) else if (n == 2L || n == 3L) return...
asked by 22.09.2018 / 15:34
5
answers

Simple 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 up to the nth term, which should be provided by the user. For example, if the user entered the number 40, 40 numb...
asked by 09.06.2017 / 05:46
1
answer

RuntimeError: 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) fibonacci_cache[n]=...
asked by 07.11.2017 / 19:51
1
answer

Sequence of fraction with fibonacci and primes

h. Ask the user how many terms he wants and print out the sequence below and    sum of terms.     1 + 1 + 2 + 3 + 5 + 8 + ...     2 3 5 7 11 13    * above Fibonacci sequence and below sequence of Cousins. I have this exercise to do, but I can...
asked by 14.10.2014 / 03:30
2
answers

Return the Fibonnaci elements from the last term to the first [duplicate]

I've returned some specific elements already, but I'm trying to get back to the first one. In the code below did I return a certain element, how do I now create from the first, to the fifth, to the tenth? def element( f ) return f...
asked by 16.10.2018 / 03:05
1
answer

Initial term of end of fibonacci sequence (closed interval) [closed]

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? Request the user the initial term and the end term of the Fibonacci sequence (closed interval) and print the result....
asked by 09.10.2014 / 17:15
5
answers

Simple 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 up to the nth term, which should be provided by the user. For example, if the user entered the number 40, 40 numb...
asked by 09.06.2017 / 05:46