You can form a vector space with 2^n and f(n) as the span. Then the matrix ((2,0)(1,3)) represents the transformation from (2^n ,f(n)) to (2^n+1 ,f(n+1)) You can diagonalize and get that ((2,0),(1,3))^n (1,f(0)) = (2^n ,3^n -2^n +f(0)*3^n ) So your f(n) is equal to 3^n -2^n +f(0)3^n