Challenge 5 – Fibonacci Sequence to X

Chambers, Charlie
Chambers, Charlie Experian Employee
edited June 2024 in Challenges
image.png

The Fibonacci Sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,.... The next number is found by adding up the two numbers before it.

-         the 2 is found by adding the two numbers before it (1+1)

-         the 3 is found by adding the two numbers before it (1+2)

-         the 5 is (2+3)

-         and so on!

image.png

Despite seemingly abstract, the Fibonacci Sequence can be used in the real world to convert miles into kilometres and vice versa. For example, when we take any two consecutive numbers from this series, as example 13 and 21 or 34 and 55, the smaller number is in miles = the other one in kilometres or we can consider the bigger number is in kilometres = the smaller one in miles.

34 Miles = round(54.72) Kilometres = 55 Kilometres

21 Kilometres = round(13.05) Miles = 13 Miles


The challenge is, starting with a table consisting of the first two numbers in the Fibonacci Sequence (0, 1), output the Fibonacci Sequence up to a parameterised value.


Example:

Input.

C6008CD3-1E8D-4CD1-9CAF-23CE076A10D0.png


Use a Workflow Parameter to set the limit of the output.

C187B43A-375A-4BD7-85C7-37A849603686.png


Output the Fibonacci Sequence up to the Workflow Parameter.

9A169D54-3AA1-48A3-B3F9-7F34AF9324B2.png

I hope you enjoy giving this challenge a go, there are lots of ways to be creative around solving this so I can’t wait to see some of your ideas (once you're ready, please post your solutions here). Happy problem solving 😊.

Comments