Solve the tribonacci problem in O(n) like solving non recursive fibnacci.