Solving [Problem](http://www.spoj.com/problems/HUSGAME/) , I got recurrence as f(n)= ~f,2018-03-25((n+1)/2) + ~f,2018-03-25(n-1) ,here ~ denotes negation, f(x) is 0 if player with x stones loose and 1 if player left with x stones wins.As n can be high as $10^{18}$ so matrix exponentiation would do this,↵
↵
↵
| ~ ~ | x | f(n) | = | f(n+1) | ↵
| 1 0 | | f(n/2+1) | | f(n) | ↵
↵
but I am unable to do algebra with this ~ operation.↵
↵
↵
↵
| ~ ~ | x | f(n) | = | f(n+1) | ↵
| 1 0 | | f(n/2+1) | | f(n) | ↵
↵
but I am unable to do algebra with this ~ operation.↵
↵