[sage-support] Re: primes and integers

2011-07-24 Thread Graham Enos
For the first question, since Sage has the prime_range() function: [p for p in prime_range(1) if mod(p, 8) in (1, 7)]. There are several ways of filtering a list in Python, but I tend to choose list comprehensions (http://en.wikipedia.org/wiki/ List_comprehension#Python) On Jul 24, 8:24 am, ra

[sage-support] Re: Maybe not a sage problem?

2011-07-12 Thread Graham Enos
I have a similar problem on Mac OS X 10.6 with Sage 4.6. I'm not what's up either, but I've just been resorting to the notebook interface when I want 3D graphics. Any help others may offer would be appreciated. Best, Graham On Jul 11, 2:17 pm, Jotace wrote: > Hi all, > > I'm using sage 4.7 on ub

[sage-support] Re: Modular Exponentiation

2011-03-17 Thread Graham Enos
Another option is to use the pow() function, as in pow(a, b, c). On Mar 17, 1:58 am, Robert Bradshaw wrote: > mod(a, c)^b > > On Wed, Mar 16, 2011 at 10:44 PM, Santanu Sarkar > > > > > > > > wrote: > > How one can calculate  a^b mod c  in Sage for large b? > > > -- > > To post to this group, sen

[sage-support] Re: Numpy Troubles

2011-02-15 Thread Graham Enos
I should have remembered that int and Integer are different. Thanks very much for setting me straight! On Feb 15, 12:38 am, "D. S. McNeil" wrote: > I think it's neither Sage nor numpy that's at fault, it's a weird > interaction (Sage 4.6.1): > > sage: import numpy > sage: numpy.binary_repr(17) >

[sage-support] Numpy Troubles

2011-02-14 Thread Graham Enos
Hi everyone, I've run into some unexpected behavior with Numpy on Sage 4.6 (running on Mac OS X 10.6.6). Specifically in the binary_repr function, I get empty strings. For instance: $ sage -- | Sage Version 4.6, Release Date: 201

[sage-support] Re: @interact DeprecationWarning

2011-01-27 Thread Graham Enos
  I've noticed this can be tricky > to do if one has functions input as strings in the interact. > > - kcrisman > > On Jan 26, 1:02 pm, Jason Grout wrote: > > > > > On 1/26/11 11:52 AM, Graham Enos wrote: > > > > Hi everybody, > > > > I wro

[sage-support] @interact DeprecationWarning

2011-01-26 Thread Graham Enos
Hi everybody, I wrote up a notebook worksheet to use in my Integral Calculus class that makes use of the @interact decorator. Whenever Ioad the worksheet for the first time, I get a deprecation warning regarding line 2558 of interact.py about deprecated function call syntax. Though not a major pro

[sage-support] Re: Regarding a Text Editor ...

2011-01-05 Thread Graham Enos
It sounds like you've got this pretty well wrapped up, but I'll add my two cents quickly. I've had great luck with Vim and its python.vim syntax file. In order to get Vim to recognize .sage files as Python files, I've added (per a tip on the Sage Wiki) the following lines to my .vimrc: """ " S

[sage-support] Re: Minimum Spanning Trees

2010-12-12 Thread Graham Enos
, > > On Mon, Dec 6, 2010 at 4:57 AM, Graham Enos wrote: > > I wasn't sure if I should submit a ticket on this or not, since it > > seems to fall under "unexpected behavior" rather than "software bug." > > I've been working through some smal

[sage-support] Minimum Spanning Trees

2010-12-05 Thread Graham Enos
Hi all, I wasn't sure if I should submit a ticket on this or not, since it seems to fall under "unexpected behavior" rather than "software bug." I've been working through some small graph theory problems and was computing minimum spanning trees on graphs with weighted edges (where edges were assig