Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Advice
0 votes
4 replies
128 views

This sequence appears to be a complex, hybrid sequence, combining elements of: Fibonacci sequence Lucas sequence Quadratic recurrence sequence Chaotic sequence (due to the sine wave patterns) It's ...
Score of 8
1 answer
293 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 ...
Score of 3
2 answers
320 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 ...
Score of 0
1 answer
116 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: ...
Score of 1
3 answers
159 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, ...
Score of 1
2 answers
114 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,...
Score of 1
2 answers
229 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 ...
Score of 4
3 answers
297 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 ...
Score of 1
2 answers
130 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....
Score of 1
1 answer
113 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 ...
Score of 0
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 ...
Score of -1
2 answers
267 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 ...
Score of 1
2 answers
137 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.) ...
Score of 0
0 answers
64 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 ...
Score of -1
1 answer
108 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"; ...

15 30 50 per page
1
2 3 4 5
159