[sage-support] Re: %auto not automatically running code when upload notebook worksheet

2011-06-22 Thread Rolf
> Thanks.  Does your version automatically start up when you upload the > worksheet? Yes, as I said it starts automatically but it must have no descriptive comment above the cell. That is a worksheet with only one naked cell and no description in it. That's why I suggested to start a new worksheet

[sage-support] Re: %auto not automatically running code when upload notebook worksheet

2011-06-22 Thread Chris Seberino
On Jun 22, 4:26 am, Rolf wrote: > Works with me, and you will see my enhancement to the code. The two > variable thing. Rolf Thanks. Does your version automatically start up when you upload the worksheet? Your version works like mine but doesn't start automatically for me like mine still. cs

[sage-support] Re: unanticipated divison by zero

2011-06-22 Thread Ken Levasseur
Yes, it's exactly what I needed. I wasn't aware of the type distinction between integers and integers mod m. What I needed to use is the lift method: s=pow(2,11,23) [type(s),type(s.lift())] [, ] Thank you! Ken On Jun 22, 8:28 pm, kcrisman wrote: > If you take a look at the code, there is so

[sage-support] Re: unanticipated divison by zero

2011-06-22 Thread kcrisman
If you take a look at the code, there is something fishy. Add the following statements. def sum_of_squares(p): if p.mod(4)==1: A=startingA(p) print A B=1 temp = A**2+B**2 print type(A**2+B**2) temp M=(A**2+B**2)/p while M>1:

[sage-support] Re: unanticipated divison by zero

2011-06-22 Thread Ken Levasseur
On Jun 22, 4:06 pm, Robert Bradshaw wrote: > What is startingA ? What is the parent of A? > The full .sws file is at http://homepage.mac.com/klevasseur/sum_of_squares.sws Ken -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

Re: [sage-support] unanticipated divison by zero

2011-06-22 Thread Robert Bradshaw
On Wed, Jun 22, 2011 at 12:35 PM, Ken Levasseur wrote: > Hello.  I'm trying to implement the algorithm for representing primes > congruent to 1 mod 4 as a sum of squares and I know the logic of the > algebra is right (identical equations work in Mathematica).  However, > I get  a "ZeroDivisionErro

[sage-support] unanticipated divison by zero

2011-06-22 Thread Ken Levasseur
Hello. I'm trying to implement the algorithm for representing primes congruent to 1 mod 4 as a sum of squares and I know the logic of the algebra is right (identical equations work in Mathematica). However, I get a "ZeroDivisionError: Inverse does not exist." error when I evaluate the expression

[sage-support] Re: %auto not automatically running code when upload notebook worksheet

2011-06-22 Thread Rolf
> "x is %d" % y is standard Python for having variables in strings. Thank, that helped a lot. In Python documentation I found the solution. > > html('In Scientific Notation: ${%d} \cdot 10^{%d}$'%base%exponent) > > > doesn't work either. > > I didn't see that inhttp://phil4.com/public/Sci.sws. I