Re: Question
- To: mathgroup at smc.vnet.net
- Subject: [mg9414] Re: Question
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Wed, 5 Nov 1997 01:56:31 -0500
- Organization: University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
Boguslaw Ptaszynski wrote: > I have a question that I hope someone has an answer for. I have the > following recurrence relation: > > a[n+2]= 1/(b^2) ( b/2 a[n] + n (n-1)/4 a[n-2] ) > > for the indices in the series n>=2. > I want to use the formula to determine the values of a[n] for > n=2,3,4,...12 and give these values in the table > > I have written : > > Clear [a,n,b] > a[n_] := a[n]= 1/(b^2) ( b/2 a[n-2] + (n-2) (n-3)/4 a[n-4] ); > a[0]=a0; a[1]=a1; Your recurence links a[n] to a[n-4]. Hence you need to supply FOUR initial values. This is what led to the $RecursionLimit error messages. Assuming that a[n]=0 for n<0, i.e. In[1]:= a[n_] := a[n] = Simplify[(1/4*(n - 3)*(n - 2)*a[n - 4] + 1/2*b*a[n - 2])/b^2]; In[2]:= a[0] = a0; a[1] = a1; a[n_ /; n < 0] = 0; In[3]:= Table[a[n], {n, 0, 12}] Out[3]= a0 a1 3 a0 7 a1 15 a0 27 a1 105 a0 {a0, a1, ---, ---, ----, ----, -----, -----, ------, 2 b 2 b 2 2 3 3 4 4 b 4 b 8 b 8 b 16 b 321 a1 945 a0 2265 a1 10395 a0 ------, ------, -------, --------} 4 5 5 6 16 b 32 b 32 b 64 b Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________