Thank you Robert for the clarification.  Since I'm an amateur programmer, could you please give me a sample of how I would do it.  I'll take some time to study arrays as well, and how to write them, I know of lists, and tuples, and dictionaries; from "Dive into Python". but I am very green around the ears still. :| <div>
<br></div><div><div class="gmail_quote">On Fri, Oct 29, 2010 at 11:16 AM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 10/29/10 12:02 AM, Chris Rebert wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz<<a href="http://whitequill.bj" target="_blank">whitequill.bj</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>>  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am working with differential equations of the higher roots of negative<br>
one. (dividing enormous numbers into other enormous numbers to come out with<br>
very reasonable numbers).<br>
I am mixing this in to a script for Maya (the final output is graph-able as<br>
a spiral.)<br>
I have heard that Sage, would be a good program to do this in, but I'd like<br>
to try and get this to work in native python if I can.<br>
The script I am trying to port to Python is; <a href="http://pastebin.com/sc1jW1n4" target="_blank">http://pastebin.com/sc1jW1n4</a>.<br>
</blockquote>
<br>
Unless your code is really long, just include it in the message in the future.<br>
So, for the archive:<br>
indvar = 200;<br>
q = 0;<br>
lnanswer = 0;<br>
for m = 1:150<br>
   lnanswer = (3 * m) * log(indvar) - log(factorial(3 * m))  ;<br>
q(m+1) = q(m)+ ((-1)^m) * exp(lnanswer);<br>
end<br>
lnanswer<br>
q<br>
<br>
Also, it helps to point out *what language non-Python code is in*. I'm<br>
guessing MATLAB in this case.<br>
<br>
Naive translation attempt (Disclaimer: I don't know much MATLAB):<br>
<br>
from math import log, factorial, exp<br>
indvar = 200<br>
q = [0]<br>
lnanswer = 0<br>
for m in range(1, 151):<br>
     lnanswer = (3 * m) * log(indvar) - log(factorial(3 * m))<br>
     q.append(q[-1] + (1 if m % 2 == 0 else -1) * exp(lnanswer))<br>
print(lnanswer)<br>
print(q)<br>
</blockquote>
<br></div></div>
I promised that I would reply when the OP posted here. Except you gave the answer that I would have.<br>
<br>
To the OP: In your code snippet, q(m+1) and q(m) are not function calls. They are array indexing operations (with the special semantics that assigning beyond the last element in the array appends a new element to the array). You are not setting the result of a function to anything, just building up an array of results. You don't need symbolic math libraries like SAGE for this.<br>

<br>
-- <br>
Robert Kern<br>
<br>
"I have come to believe that the whole world is an enigma, a harmless enigma<br>
 that is made terrible by our own mad attempt to interpret it as though it had<br>
 an underlying truth."<br>
  -- Umberto Eco<br><font color="#888888">
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br></div>