The generalized recurrence formula is
F[n_]:=F[n]=F[n-1]+F[n-p-1];
with the initial conditions
F[-p-1]=0; F[-p]=1; F[-p+1]=0; ...F[0]=0; F[1]=1; ... F[p+1]=1;.
Note that, for p=1
F[-1]=1;
. I want to find positive and negative values according to p
. For example, If p=2
then the formula has the form
F[n_]:=F[n]=F[n-1]+F[n-3];
with initial conditions F[0]=0; F[1]=1; F[2]=1;
(for positive numbers) and F[0]=0; F[-1]=0; F[-2]=1;
(for negative numbers).
I have achieved the calculation of positive numbers but I didn't find numbers for negative n
values. Is there any code for the calculation for this process?
Thank you.
F[n]
, one for positive n and one for negative n? That's the only way I can think of to interpret your question that doesn't overdetermine the recursion relation. (Otherwise you have $p+1$ constants that you're trying to constrain with $2p+3$ equations, and I would worry that the system would be overdetermined.) $\endgroup$ – Michael Seifert Jan 14 '16 at 15:00p=2
and the valuesn={1,2,3,4,5,6,7,8,9,10}
andn={-1,-2,-3,-4,-5,-6,-7,-8,-9,-10}
? $\endgroup$ – drxy Jan 14 '16 at 15:05