Hi Pong,

On 17 Aug., 09:20, pong <wypon...@gmail.com> wrote:
> Hum...
>
> [radical(k) for k in [1..30]] produces the expected list however
>
> [radical(k) for k in range(1,31)] rises an error
>
> AttributeError: 'int' object has no attribute 'factor'

That's no surprise, because "range" is Python and thus produces Python
ints, not Sage Integers.

There is a Sage-equivalent of range, namely srange, which works fine
in your example:

sage: [radical(k) for k in srange(1,31)]
[1, 2, 3, 2, 5, 6, 7, 2, 3, 10, 11, 6, 13, 14, 15, 2, 17, 6, 19, 10,
21, 22, 23, 6, 5, 26, 3, 14, 29, 30]

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to