I am having an issue with the RSolveValue
/RSolve
function. Specifically, Mathematica is able to correctly evaluate RSolveValue[{f[0] == 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[0] == 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!