Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum > General > > "b=a+1, c=b+1, d=c+1... x=?"

Post Reply:
Name:
Email Address:

Please send email when my message is replied to.

Url (optional):
Subject:
Message: view original message?
Attachment (optional):
Please answer this:1+1 =



Original Message (ID '198372') By jf:
In[2]:= y[0] = 4; y[n_Integer?Positive] := y[n - 1] + 1; In[4]:= y[4] Out[4]= 8 You could probably get away with y[n_] := y[n - 1] + 1; for the recursive definition, but the extra will prevent an infinite recursion in case an invalid argument is given. http://reference.wolfram.com/mathematica/tutorial/PuttingConstraintsOnPatterns.html