How to find the nth term of the recurrence in log(n) time.
F[n]=F[n-1]+F[n-3]
F[2]=1;
F[3]=2;
F[4]=3;
F[5]=4;
I could not create the required matrix to exponentiate. Sorry if this seems somewhat off-topic.
Thanks but i found the answer. https://math.stackexchange.com/questions/891964/generalised-fibonacci/891979#891979