Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-17 Thread CTSB01
I've been puzzling over how to get a certain function working in Python. The function, takes positive integers to other positive integers as follows: Phi_m(n2) = Phi_m(m*n + r) = m*x[n1] + r*(x[n1 + 1] - x[n1]) The above terms are all integer valued and are defined as follows: n2 = the

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Joshua Landau
On 18 July 2013 00:58, CTSB01 wrote: > Please let me know if this is unclear. I will certainly continue revising > until it makes sense to those reading. Can you summarize what your question is? Leave aside the details of the function, just explain what thing in particular you aren't able to do

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 5:12:08 AM UTC-4, Joshua Landau wrote: > On 18 July 2013 00:58, CTSB01 wrote: > > > Please let me know if this is unclear. I will certainly continue revising > > until it makes sense to those reading. > > > > Can you summarize what your question is? Leave aside the

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Gary Herron
On 07/18/2013 02:57 PM, CTSB01 wrote: On Thursday, July 18, 2013 5:12:08 AM UTC-4, Joshua Landau wrote: On 18 July 2013 00:58, CTSB01 wrote: Please let me know if this is unclear. I will certainly continue revising until it makes sense to those reading. Can you summarize what your questi

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 6:12:52 PM UTC-4, Gary Herron wrote: > On 07/18/2013 02:57 PM, CTSB01 wrote: > > > On Thursday, July 18, 2013 5:12:08 AM UTC-4, Joshua Landau wrote: > > >> On 18 July 2013 00:58, CTSB01 wrote: > > >> > > >>> Please let me know if this is unclear. I will certainly co

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Ian Kelly
On Jul 18, 2013 4:23 PM, "CTSB01" wrote: > > File "", line 2 > ... rtn = [] > ^ The "..." is the continuation prompt from the interactive interpreter, not part of the code. Don't paste it into Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 6:49:03 PM UTC-4, Ian wrote: > On Jul 18, 2013 4:23 PM, "CTSB01" wrote: > > > > > >   File "", line 2 > > >     ...   rtn = [] > > >     ^ > > The "..." is the continuation prompt from the interactive interpreter, not > part of the code. Don't paste it into Python.

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Ian Kelly
On Thu, Jul 18, 2013 at 5:04 PM, CTSB01 wrote: > Thanks Ian. That worked regarding that issue. Now I have an 'invalid > syntax' issue unfortunately. > >>> def phi_m(x,m): > rtn = [] > for n2 in range(0, len(x)*m - 2): > n = n2 / m > r = n2 - n * m > rtn.appen

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Ian Kelly
On Thu, Jul 18, 2013 at 5:42 PM, Ian Kelly wrote: > On Thu, Jul 18, 2013 at 5:04 PM, CTSB01 wrote: >> Thanks Ian. That worked regarding that issue. Now I have an 'invalid >> syntax' issue unfortunately. >> def phi_m(x,m): >> rtn = [] >> for n2 in range(0, len(x)*m - 2): >>

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Rhodri James
On Fri, 19 Jul 2013 00:04:33 +0100, CTSB01 wrote: On Thursday, July 18, 2013 6:49:03 PM UTC-4, Ian wrote: On Jul 18, 2013 4:23 PM, "CTSB01" wrote: > > File "", line 2 > ... rtn = [] > ^ The "..." is the continuation prompt from the interactive interpreter, not part of the

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 07:04 PM, CTSB01 wrote: On Thursday, July 18, 2013 6:49:03 PM UTC-4, Ian wrote: On Jul 18, 2013 4:23 PM, "CTSB01" wrote: File "", line 2 ... rtn = [] ^ The "..." is the continuation prompt from the interactive interpreter, not part of the code. Don't

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 7:45:49 PM UTC-4, Ian wrote: > On Thu, Jul 18, 2013 at 5:42 PM, Ian Kelly wrote: > > > On Thu, Jul 18, 2013 at 5:04 PM, CTSB01 wrote: > > >> Thanks Ian. That worked regarding that issue. Now I have an 'invalid > >> syntax' issue unfortunately. > > >> > > def

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
> It's only obvious if you're using Python 3.x. You have forgotten the > > parentheses in the call to the print() function. > > > On the other hand, if this is Python 2.x, I have no idea. Next time, > > please paste the actual error, not paraphrased. The error message > > includes a tra

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 08:35 PM, CTSB01 wrote: > It's only obvious if you're using Python 3.x. You have forgotten the parentheses in the call to the print() function. On the other hand, if this is Python 2.x, I have no idea. Next time, please paste the actual error, not paraphrased. The error me

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
Thanks for the alternative links, I'll use gmane.org as an access point next time. > > Don't paraphrase. Just copy/paste it into your email message. And I'm > > assuming you know to run things from the terminal window, and not from > > IDLE or something else that messes up the error messag

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 10:16 PM, CTSB01 wrote: Does something like def phi_m(x, m): rtn = [] for n2 in range(0, len(x) * m - 2): n = n2 / m r = n2 - n * m rtn.append(m * x[n] + r * (x[n + 1] - x[n])) print ('n2 =', n2, ': n ='

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Fábio Santos
On 19 Jul 2013 03:24, "CTSB01" wrote: > > Thanks for the alternative links, I'll use gmane.org as an access point next time. > > > > > Don't paraphrase. Just copy/paste it into your email message. And I'm > > > > assuming you know to run things from the terminal window, and not from > > > > IDLE

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 10:48:23 PM UTC-4, Fábio Santos wrote: > On 19 Jul 2013 03:24, "CTSB01" wrote: > > > > > > Thanks for the alternative links, I'll use gmane.org as an access point > > next time. > > > > > > > > > > > Don't paraphrase.  Just copy/paste it into your email message.  A

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread CTSB01
On Thursday, July 18, 2013 10:43:11 PM UTC-4, Dave Angel wrote: > On 07/18/2013 10:16 PM, CTSB01 wrote: > > Does something like > > > > > > def phi_m(x, m): > > >rtn = [] > > >for n2 in range(0, len(x) * m - 2): > > > n = n2 / m > > > r = n2