Fibonacci series multiple

python program for nth multiple of a fibonacci numbercould you please explain this question.Also can we do this question using only loop :disappointed_relieved:

@brindhubala30

Yes , you can do it through loop.
Below is the explanation of the logic with example please go through it and perform well in the question.

Here is the Fibonacci sequence again:

n = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 …
xn = 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 …
There is an interesting pattern:

Look at the number x3 = 2. Every 3rd number is a multiple of 2 (2, 8, 34, 144, 610, …)
Look at the number x4 = 3. Every 4th number is a multiple of 3 (3, 21, 144, …)
Look at the number x5 = 5. Every 5th number is a multiple of 5 (5, 55, 610, …)
And so on (every nth number is a multiple of xn).

Example :

Input: k = 2, n = 3
Output: 9, 3rd multiple of 2 in Fibonacci Series is 34 that appears at position 9.

Input: k = 4, n = 5
Output: 30, 5th multiple of 4 in Fibonacci Series is 832040 which appears at position 30.

1 Like