Re: how to iterate
- To: mathgroup at smc.vnet.net
- Subject: [mg66874] Re: how to iterate
- From: "Dana" <ddelouis at bellsouth.net>
- Date: Fri, 2 Jun 2006 04:08:59 -0400 (EDT)
- References: <e2i987$9fc$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi.
f[1] = 1; f[2] = 2; f[3] = 3;
Table[f[n] = (f[n - 1] + f[n - 2] + 1)/f[n - 3], {n, 4, 17}]
{6, 5, 4, 5/3, 4/3, 1, 2, 3, 6, 5, 4, 5/3, 4/3, 1}
?f
Note that there are only 8 unique outputs, as the output pattern repeats.
You could use
Mod[n, 8, 1]
on any integer n to convert it to a number 1-8, and select one of your 8
outputs.
--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003, Mathematica 5.2
"vr" <valentino.rossi.85 at gmail.com> wrote in message
news:e2i987$9fc$1 at smc.vnet.net...
> 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.
>