Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
8 votes
1 answer
272 views

How can I calculate Nth term in Fibonacci sequence of order K efficiently? For example, Tribonacci is Fibonacci order 3, Tetranacci is Fibonacci order 4, Pentanacci is Fibonacci order 5, and Hexanacci ...
3 votes
2 answers
264 views

The closed-form of the Fibonacci series is the following: As you can see the expression contains square roots so we cannot use it directly to generate Nth Fibonacci number exactly, as sqrt(5) is ...
0 votes
1 answer
110 views

These operations take priority: If A1 Prime: subtract previous prime (if 1 treat as odd number) If A1 Perfect Square: square root While these are the conditions if those aren't true: If A1 Even: ...
1 vote
3 answers
140 views

I want to write a function that returns a number based on the fibonacci rule where each new number returned is based on the sum of the two previous numbers 1, 1, 2, 3, 5, etc. So if the user inputs 4, ...
1 vote
2 answers
98 views

Each method is getting large variations in computation time, even with lots of repeats (to obtain a mean). The effect appears to get worse with larger n. This is my timing code. def timeBlock(func, n,...
Lockyli's user avatar
  • 19
1 vote
2 answers
187 views

From Structure and Implementation of Computer Programs, second edition: Exercise 1.19: There is a clever algorithm for computing the Fibonacci numbers in a logarithmic number of steps.Recall the ...
4 votes
3 answers
274 views

Question: I have a program that calculates the Fibonacci number. When I set a large number of passes, it runs extremely slow because it only works with 1 CPU core, I want to know how to make it ...
1 vote
2 answers
117 views

I was solving a test on an online platform and the problem statement was similar to this. Stuart has to go from one place to other (A-> B) and he can jump either 1 step, 2 step or 3 steps at a time....
1 vote
1 answer
96 views

i ́ve written a code in assembly that recursively calculates the fibonacci sequence for a number. the code is for a RISC V processor. The code works correctly for the numbers 1 and 2 but everything ...
0 votes
0 answers
40 views

I'm learning 8086 assembly through college course and i ran into a problem. I'm trying to calculate Fibonacci sequence to 46 places but 16-bits registers inside this processors can't handle large ...
-1 votes
3 answers
216 views

I'm trying to make a class that generates a Fibonacci sequence. My two modules are below, the fibonacci.py module and the test_fibonacci.py module. The first two tests pass but the third one seems to ...
JSO's user avatar
  • 21
1 vote
2 answers
125 views

Question: Is it possible to compute the nth Fibonacci number using forward recursion with memoization? If so, how? If not, why not? Context: Most learning resources and books (e.g., CLRS, DPV, etc.) ...
0 votes
0 answers
61 views

I am using x86 assembly MASM to compute first 41 fibonacci numbers. I initially had an array set to size 41, with 0's. This causes correct output for first 10ish values, with remaining indices being ...
-1 votes
1 answer
102 views

I have this Fibonacci script #!/bin/bash if (test $# -ne 1) then echo "Use: 0ドル number" exit 1 fi for c in ‘seq 1 1ドル‘ do if (($c == 1)) then n0=1; echo "fibonacci(1)=$n0"; ...
Gigi's user avatar
  • 111
0 votes
1 answer
77 views

I tried to solve Fibonacci series problem in rust, but unfortunately it always return me exponent of 2^n. Here is my code: use std::io; // Fibonacci Series Number // F(n) = 1,1,2,3,5,8,13,....(n-1),((...
user avatar

15 30 50 per page
1
2 3 4 5
...
159

AltStyle によって変換されたページ (->オリジナル) /