The goal is to sum up to the n-th term of the Fibonacci Number, a popular sequence in mathematics.
F0=0, F11=1, Fn+2n+2=Fn+1n+1+Fnn
We can define the Fibonacci sequence with the recurrence relation as above.
Based on the 0th term being 0 and the 1st term being 1, from the 2nd term, the number of the previous two is added.
Listed below is the outcome:
(0), 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 ... and so on.
Write a program to sum up to the n-th Fibonacci Number
Input
Natural number (less than 30)
Output
Sum of Fibonacci Sequence Terms from 1 to natural number Entered