Re: how to iterate
- To: mathgroup at smc.vnet.net
 - Subject: [mg65978] Re: how to iterate
 - From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
 - Date: Tue, 25 Apr 2006 05:19:12 -0400 (EDT)
 - Organization: The Open University, Milton Keynes, UK
 - References: <e2i987$9fc$1@smc.vnet.net>
 - Sender: owner-wri-mathgroup at wolfram.com
 
vr wrote:
> hi all,
> 
> pls excuse my ignorance. i'm still new to mathematica, and i forgot
> much of what i had learned.
> 
> how can i list the output of the function below for n=4..2006?
> f(n) = ( f(n-1) + f(n-2) + 1 ) / f(n-3)
> given f(1)=1, f(2)=2, f(3)=3.
> 
> thanks for any help in advance.
> 
f[1] = 1; f[2] = 2; f[3] = 3;
f[(n_Integer)?Positive] := f[n] = (f[n - 1] + f[n - 2] + 1)/f[n - 3];
Table[f[n], {n, 4, 2006}]
HTH,
Jean-Marc