The following code
f[k_, n_] :=
Sum[2*(1 + Sum[f[k - j, n - m - j], {j, 1, k - 1}]), {m, 1,
n - k + 1}]
f[4, 7]
f[4, n]
gives the output:
192
-(2/3) (261 - 342 n + 157 n^2 - 30 n^3 + 2 n^4)
But if I then define the function
g[n_] := -(2/3) (261 - 342 n + 157 n^2 - 30 n^3 + 2 n^4)
And evaluate it at $n=7$ I get a different answer:
g[7]
gives the output:
-48
What is going on here?
f
seems to be missing some boundary conditions. $\endgroup$