Message Boards Message Boards

0
|
11014 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I define a sequence from a recurrence?

Posted 9 years ago
POSTED BY: Jean F.
2 Replies
Posted 9 years ago

Thank you for your answer... I realize I might have given the wrong tags to my question, it is not a mathematica program, just the input that I give to Wolfram Alpha... ( Sequence with 2 and Sequence with 3 )

Could this overflow that you mention be the reason of the strange output in the second case? Or am I doing a stupid mistake somewhere?

POSTED BY: Jean F.

Please provide your code...but the most likely is that you do not use a SetDelayed (:=) for the definition of u[n] or that you don't Clear u before redefining it.

In[1]:= Clear[u]
u[0] = 1;
u[n_] := (2^u[n - 1])/n

In[4]:= u /@ Range[0, 4] // N

Out[4]= {1., 2., 2., 1.33333, 0.629961}

In[5]:= Clear[u]
u[0] = 1;
u[n_] := (3^u[n - 1])/n

In[8]:= u /@ Range[0, 4]

Out[8]= {1, 3, 27/2, 531441 Sqrt[3], 3^(531441 Sqrt[3])/4}

Please note that the recurrence with a 3 is quickly divergent (overfow at n=5).

In[9]:= u[4] // N

Out[9]= 2.054631331186877*10^439181

In[10]:= u[5] // N

During evaluation of In[10]:= General::ovfl: Overflow occurred in computation. >>

Out[10]= Overflow[]
POSTED BY: Christian Neel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract