Hey guys, I have a function that I implemented easily using regular recursion but I've been trying to figure out how to write it using tail recursion instead, I can't seem to wrap my head around it though at all.
The function is:
if n < 4:
f(n) = n
f(n) = f(n - 1) + 2(f(n - 2)) + 3(f(n - 3)) + 4(f(n - 4))
Can anyone help me figure out how to solve this using tail recursion?