# RSolve solves only one of two equivalent recurrences

I am having an issue with the RSolveValue/RSolve function. Specifically, Mathematica is able to correctly evaluate RSolveValue[{f == 1, f[n] == Sum[f[i], {i, 0, n - 1}]}, f[n], n] to Piecewise[{{Power[2, n - 1], n > 0}, {1, n == 0}}, 0], but fails if the indices of the summation are shifted by one: RSolveValue[{f == 1, f[n] == Sum[f[i+1], {i, -1, n - 2}]}, f[n], n] does not evaluate, even though the two summations seem to be clearly equivalent. Is there some way to nudge Mathematica into realizing that these two recurrences are one and the same?

I should note that this issue arises while I am using Mathematica programmatically in Python to do analysis (though the issue is reproducible in the standard Mathematica application). As such, even though there is a case where RSolve is working, the symbolic math library that I am using sometimes produces the shifted indices, and I am hoping that it will be an easier fix to have Mathematica resolve the shifted summation rather than transform the symbolic Python expression.

My Mathematica installation is version 12.3.0.0. Thank you for any help!

\$Version

(* "13.2.1 for Mac OS X ARM (64-bit) (January 27, 2023)" *)

ClearAll["Global*"];

RSolveValue[{f == 1, f[n] == Sum[f[i + 1], {i, -1, n - 2}]}, f[n], n] If you cannot restructure the sum, use the recursive definitions to generate a sequence, then try using FindSequenceFunction to find the closed-form.

f2 = 1;
f2[n_Integer?Positive] := f2[n] = Sum[f2[i + 1], {i, -1, n - 2}]

f[n_Integer?NonNegative] = Piecewise[{
{FindSequenceFunction[f2 /@ Range, n], n > 0}, {1, n == 0}}] And @@ (f[#] == f2[#] & /@ Range[0, 20])

(* True *)

• It is an unfortunate weakness that this sort of trick would be needed. An advantage is that it will work if the recurrence is linear (as in the example) and if given sufficiently many terms. May 12 at 15:52

Would this work for you?

RSolveValue[{f == 1, f[n] == 1 + Sum[f[i + 1], {i, 0, n - 2}]},
f[n], n]

• Thank you for your response, but I more so am looking for any flags or assumptions to give Mathematica such that it directly evaluates RSolveValue[{f == 1, f[n] == Sum[f[i+1], {i, -1, n - 2}]}, f[n], n]`. While your code is another equivalent formulation that Mathematica is able to evaluate, it would require me to transform the original recurrence into the form in your answer, which leaves me in the same situation that I am in currently. Jun 25, 2021 at 19:18
• This seems to be a deficiency in RSolve to me. Can you transform so that the initial index in the sum is the same as the first index in the first term? Jun 25, 2021 at 21:06
• Yes, if this is truly a deficiency in RSolve, then I'll have to do some sort of preprocessing in my code along those lines. Hopefully, I can find a heuristic to normalize the summation such that Mathematica will accept it for all the recurrences I come across. Jun 25, 2021 at 22:11