This is the solution for the Fibonacci Modified Problem found under the dynamic programming section at hackerrank. You need to find the (n+k)th term of the generated series, where nth and (n+1)th term will be supplied as input.
The nth and (n+1)th terms, the (n+2)th can be computed by the following relation :
Tn+2 = (Tn+1)2 + Tn
So, if the first two terms of the series are 0 and 1 and k is 5 then
the third term = 12 + 0 = 1
fourth term = 12 + 1 = 2
fifth term = 22 + 1 = 5
Found Bugs, feel free to report them !
Latest posts by Bikash Panda (see all)
- Firmata protocol with Raspberry Pi and Arduino - September 13, 2017
- IOT:Power outlet controlled from internet using WeMOS - August 9, 2017
- OSMC on Raspberry PI with Setup and Control using Android App - July 7, 2017