The Fibonacci sequence is the
series of numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, … The next number is found by adding up the two numbers before it. (source)
Your task is to ask for a number and the program should return the digit of the series.
fibonacci(8) => 3 #1, 1, 2, 3, 5, 8, 1𝟯,...
fibonacci(18) => 4
fibonacci(24) => 7
fibonacci(234) => 3
fibonacci(1834) => 5
btw, start the sequence from 1 instead from 0.
This is a variation of
This is your quest for today:
The Fibonacci Sequence is the sequence of numbers (Fibonacci Numbers) whose sum is the two preceding numbers (e.g. 0, 1, 1, 2, 3, etc). Using 0 and 1 as the starting values, create a procedure that returns an result containing all of the Fibonacci numbers less than 255.
Great to see the daily challenges again. Thanks
I will be posting my solution here, but if you want to solve this I suggest not opening the answer.
You can also download my original Python source code:
fibonacciSequence/src-py at master · ontstudios/fibonacciSequence · GitHub
a little tip. The initialize local block is a mutator block. Any block with the blue gear sign is one.
So you could have made your variables block like this.
You are using less blocks and it looks tidier.
Thanks. This was my first time using these initialize local blocks, so I really didnt know what to do. I was skeptical if my program would even work. Thanks Peter!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.