Although the problem is for recursion, i have been solving some of these using DP, by taking an array and applying the recurrence relations, is it alright??? i know i can also use matrix exponentiation but i am in no mood to code it right now , considering the constraints are not large enough for it .