# Solving an Equation (Recursively)

I have the following Values: $a=1;a=0;a=0;a=0;a=\frac{g_2}{20};a=0$.

I need to compute the value of $b[n]$ in the following equation

$$a[n]=\sum _{m=0}^{n} (m-2) \;\;a[m] \;\;b[n-m]$$ where $n=0,1,2,3,4,5$.

For $n=0$, I get the value of $b$.

For $n=1$, I get the value of $b$ using the value of $b$.

For $n$th iteration, I get the value of $b[n]$ using the values of $b[n-1],b[n-2],\dots,b$.

The values of $b[n]$ will then be used to solve for another variable, say, $c[n]$, for $n=0,1,2,3,4,5$.

Is there any simple way of doing this in Mathematica? I am basically doing one iteration at a time (using the Solve command), which is very tedious.

a = 1; a = a = a = a = 0; a = g2/20;
funcs = Table[a[n] == Sum[(m - 1) a[m] b[n - m], {m, 0, n}], {n, 0, 5}]
var = b /@ Range[0, 5]
Solve[funcs, var] • Hi, Thanks. How do I then "call" these $b[n]$ values? I need to use these for another sum? – Radz Jul 28 '14 at 14:18
• soln = Solve[eqns, Array[b, 6, 0]] and then Evaluate[Array[b, 6, 0]] = Flatten[Array[b, 6, 0] /. soln] – Wouter Jul 28 '14 at 16:09
• Dear @Chenminqi, Thanks. – Radz Jul 29 '14 at 1:09
• Dear @Wouter, Thank you for your help. – Radz Aug 11 '14 at 2:07
Evaluate[Array[a, 6, 0]]= {1, 0, 0, 0, c, 0};
eqns = Table[ a[n] == Sum[(m - 2) a[m] b[n - m], {m, 0, n}], {n, 0, 5}];
Solve[eqns, Array[b, 6, 0]]

{{b->-(1/2),b->0,b->0,b->0,b->-c,b->0}}
`
• Hi, How do I then "call" these $b[n]$ values? I need to use these for another sum? – Radz Jul 28 '14 at 14:18