Re: Single Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg5322] Re: Single Problem
- From: haberndt at dnai.com (Harald Berndt)
- Date: Wed, 27 Nov 1996 01:47:38 -0500
- Organization: DNAI ( Direct Network Access )
- Sender: owner-wri-mathgroup at wolfram.com
In article <5764ab$28t at dragonfly.wolfram.com>, Redirley Matheus Santos
<yelride at ibm.net> wrote:
> Hi everybody,
>
> Who would like solve this problem ?
>
> X is a Integer number
> X = Sqr(6+(Sqr(6+(Sqr(6+Sqr(6+Sqr(...))))))) infinite Sqr of 6 inside
> X = ?
Do you really mean Sqr?
If I read your problem correctly, you want something like
In[17]:=
NestList[(6+#)^2&, x, 3]
Out[17]=
2 2 2 2 2 2
{x, (6 + x) , (6 + (6 + x) ) , (6 + (6 + (6 + x) ) ) }
... and that grows to infinity really fast:
In[20]:=
NestList[(6+#)^2&, 1, 3]
Out[20]=
{1, 49, 3025, 9186961}
In[21]:=
NestList[(6+#)^2&, .1, 3]
Out[21]=
6
{0.1, 37.21, 1867.1, 3.50852 10 }
Out[22]=
-16 6
{1. 10 , 36., 1764., 3.1329 10 }
In[24]:=
$MachineEpsilon
Out[24]=
-19
1.0842 10
In[25]:=
NestList[(6+#)^2&, $MachineEpsilon, 3]
Out[25]=
-19 6
{1.0842 10 , 36., 1764., 3.1329 10 }
It's quite different for the square root, as one can demonstrate with
In[31]:=
ListPlot[
NestList[Sqrt[6+#]&, 1., 30],
PlotRange -> All
];
To find that level off "limit", apply
In[32]:=
FixedPoint[Sqrt[6+#]&, 1.]
Out[32]=
3.
In[33]:=
FixedPoint[Sqrt[6+#]&, $MachineEpsilon]
Out[33]=
3.
Best,
--
Harald Berndt, Ph.D. Research Specialist,
Voice: 510-652-5974 Consultant
FAX: 510-215-4299