So I'm not looking for a general solution but rather a specific one. I'm calculating the time complexity of an algorithm and I would want to be able to formulate the growth of the constants with a good-looking formula.
The sequence is as follows: {1, 4, 13, 40, 121, 364...}. I see that the sequence grows as $f(n) = 3 * f(n-1) + 1$, but is there any way to formulate this sequence non-recursively?