4 ms·
Damn... and here I am trying to refactor it... I even got as far as: F(n) = F(n-1) + F(n+2) -> F(n) + F(n-3) = F(n-2) --> F(n) = F(n-2) - F(n-3) so
by jurjenh 15y ago
Damn... and here I am trying to refactor it... I even got as far as:
F(n) = F(n-1) + F(n+2)
-> F(n) + F(n-3) = F(n-2)
--> F(n) = F(n-2) - F(n-3)
so with F(0) = 0 and F(1) = 1 it gives F(3) = 1, but then you kinda need to figure out what F(2) may be...
Oh well, on to the next problem then.