       Re: Re: Limit

• To: mathgroup at smc.vnet.net
• Subject: [mg64720] Re: [mg64701] Re: Limit
• From: Daniel Lichtblau <danl at wolfram.com>
• Date: Wed, 1 Mar 2006 04:11:39 -0500 (EST)
• References: <dtrvmt\$lv0\$1@smc.vnet.net> <200602280649.BAA17617@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

David W. Cantrell wrote:
> =?UTF-8?Q?Sinan_Kap=C3=A7ak?= <sinankapcak at yahoo.com> wrote:
>
>>i want to find the value of the limit
>>
>>1+(2/(3+(4/(5+(6/(7+...
>>
>>how can i do that with Mathematica?
>
>
> I would also be interested to see that done in Mathematica.
>
> BTW, the desired value seems to be (Sqrt[E] + 1)/(E - 1).
>
> David

I should point out that, unlike, say, Euler, I am not able to find this
without Mathematica. Here is one derivation.

I'll start with a finite approximation so we can check the value later.

g[n_] := 1 + Fold[#2[]/(#2[]+#1)&, 1,
Reverse[Partition[Range[2,2*n],2]]]

The value of interest, should we be able to find it, is g[Infinity].

In:= N[g,100]
Out=
1.5414940825367982841311034444725146383404592368418821094741369566375\
426391433148070718257240850077422

To find the exact value we define

f[n_] := (2*n)/((2*n+1) + f[n+1])

In this formulation it is 1+f that we want to compute. We will start
with f[Infinity] and work backwards, so to speak. The limiting value,
provided it exists (not hard to show it does), is found as below.

In:= InputForm[sol = Solve[((2*n+1)+finf)*finf==2*n, finf]]
Out//InputForm=
{{finf -> (-1 - 2*n - Sqrt[1 + 12*n + 4*n^2])/2},
{finf -> (-1 - 2*n + Sqrt[1 + 12*n + 4*n^2])/2}}

In:= Limit[finf /. sol, n->Infinity]
Out= {-Infinity, 1}

Well, it's not negative, let alone infinite, so the limiting value is 1.
Now we'll solve the recurrence for f[n] noting that the limiting value is 1.

soln = First[
RSolve[((2*n+1)+f[n+1]) * f[n] - 2*n == 0, f[n], n]];

In:= InputForm[fn = f[n] /. soln]
Out//InputForm=
(-2*Sqrt[E]*n*Gamma[n]*Gamma[1 + n] +
C*Gamma[1 + n]*Gamma[-1 + n, -1/2] -
n*C*Gamma[1 + n]*Gamma[-1 + n, -1/2] +
n*C*Gamma[n]*Gamma[n, -1/2] -
2*n^2*C*Gamma[n]*Gamma[n, -1/2])/
(Gamma[n]*(Sqrt[E]*Gamma[1 + n] + n*C*Gamma[n, -1/2]))

We now need to find C. We use the fact that the limiting value of f
as n->Infinity is finite (so we did not really need to know it is 1). We
start by finding a low order series approximation and look carefully at
it to deduce the circumstances under which it will be finite.

ser = Series[fn, {n,Infinity,1}, Assumptions->n>2^10];

In:= InputForm[nser = Together[Simplify[
Normal[ser], Assumptions->n>2^10]]]
Out//InputForm=
(-2*Sqrt[n]*(2^(1/2 + n)*n^(1/2 + n)*Sqrt[E*Pi] +
3*2^(5/2 + n)*n^(3/2 + n)*Sqrt[E*Pi] -
6*(-1)^n*E^(1/2 + n)*C -
3*2^(3/2 + n)*n^(1/2 + n)*Sqrt[Pi]*C +
3*2^(5/2 + n)*n^(3/2 + n)*
Sqrt[Pi]*C))/(2^(1/2 + n)*n^n*Sqrt[E*Pi] +
3*2^(5/2 + n)*n^(1 + n)*Sqrt[E*Pi] -
12*(-1)^n*E^(1/2 + n)*Sqrt[n]*C +
3*2^(5/2 + n)*n^(1 + n)*Sqrt[Pi]*C)

This is a bit hard to handle so we'll separate numerator and
denominator, and substitute for exponents in n.

rul = {E^(a_+n)->E^a*en, 2^(a_+n)->2^a*tn, n^(a_+n)->n^a*nn, n^n->nn};
{num,den} = {Numerator[nser],Denominator[nser]} //. rul;

In:= InputForm[num = Collect[num, {nn,en,tn,n}]]
Out//InputForm=
12*(-1)^n*Sqrt[E]*en*Sqrt[n]*C +
nn*tn*(-2*n*(Sqrt[2*E*Pi] - 6*Sqrt[2*Pi]*C) -
2*n^2*(12*Sqrt[2*E*Pi] + 12*Sqrt[2*Pi]*C))

In:= InputForm[den = Collect[den, {nn,en,tn,n}]]
Out//InputForm=
-12*(-1)^n*Sqrt[E]*en*Sqrt[n]*C +
nn*tn*(Sqrt[2*E*Pi] + n*(12*Sqrt[2*E*Pi] + 12*Sqrt[2*Pi]*C))

At this point we can see that the largest term in the numerator involves
n^n*2^n*n^2, while the largest in the denominator involves n^n*2^n*n,
UNLESS C is -Sqrt[E]. Hence for f[Infinity] to exist we require that
C be -Sqrt[E].

[Note 1: an attempt to check this is a bit problematic. Numerically we
can substitute large n into fn /. C->-Sqrt[E] and it will evaluate to
something close to 1. Taking an explicit limit exposes limitations in
Limit (depending on version, either an inability to evaluate it, or an
incorrect infinite result).]

[Note 2: the derivation of C is a bit fishy in general. We are
relying  on Series of gammas at infinity to get a series expansion even
though we know the limit computation, which uses Series, is problematic.
Moreover if we sustitute C->-Sqrt[E] into our series we still do not
see convergence although the largest terms are gone. My guess is this
series needs more work. All the same C is in fact -Sqrt[E]. ]

We return to the problem at hand. With the correct value of C we can
now evaluate our function.

In:= InputForm[result = Simplify[1+fn /. {C->-Sqrt[E], n->1}]]
Out//InputForm= (-1 + Sqrt[E])^(-1)

In:= InputForm[N[result,100]]
Out//InputForm=
1.541494082536798284131103444472514638340459236841882109474136956637542639143\
3148070718257240850077422421968336254852`100.

This certainly agrees with g above.

Daniel Lichtblau
Wolfram Research

• Prev by Date: Re: Strange problem with InverseSeries
• Next by Date: Re: Re: General--Making the DisplayFormula style in ArticleModern look like Traditional
• Previous by thread: Re: Strange problem with InverseSeries
• Next by thread: Re: Limit