Re: [sage-support] Factors of an integer

2012-01-17 Thread Keshav Kini
For anyone who found this thread by Google, or anyone else who is 
interested, the function is divisors().

-Keshav


Join us in #sagemath on irc.freenode.net !

-- 
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


Re: [sage-support] Factors of an integer

2012-01-17 Thread Santanu Sarkar
Sorry. I get the function.

On 17 January 2012 18:58, Santanu Sarkar  wrote:
> Thanks. But this function gives only prime factors. Is there any
> function which gives
> all divisor?
>
> On 17 January 2012 00:39, Renan Birck Pinheiro  
> wrote:
>>
>>
>> 2012/1/16 Santanu Sarkar 
>>>
>>> Is there any function in Sage by which I can get the
>>> number of prime factors,  number of factors of a
>>> positive ineger?
>>>
>> If I understand you correctly:
>>
>> sage: factor(372)
>> 2^2 * 3 * 31
>>
>> One can get the number of factors by using 'len' on the result of this or in
>> tuples form by using 'list':
>>
>> sage: len(factor(372))
>> 3
>> sage: list(factor(372))
>> [(2, 2), (3, 1), (31, 1)]
>>
>> Renan
>> --
>> Renan Birck Pinheiro, Grupo de Microeletrônica, Engenharia Elétrica, UFSM -
>> Santa Maria, Brazil
>>
>> http://renanbirck.blogspot.com / skype: renan.ee.ufsm
>>
>>
>> --
>> 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

-- 
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


Re: [sage-support] Factors of an integer

2012-01-17 Thread Santanu Sarkar
Thanks. But this function gives only prime factors. Is there any
function which gives
all divisor?

On 17 January 2012 00:39, Renan Birck Pinheiro  wrote:
>
>
> 2012/1/16 Santanu Sarkar 
>>
>> Is there any function in Sage by which I can get the
>> number of prime factors,  number of factors of a
>> positive ineger?
>>
> If I understand you correctly:
>
> sage: factor(372)
> 2^2 * 3 * 31
>
> One can get the number of factors by using 'len' on the result of this or in
> tuples form by using 'list':
>
> sage: len(factor(372))
> 3
> sage: list(factor(372))
> [(2, 2), (3, 1), (31, 1)]
>
> Renan
> --
> Renan Birck Pinheiro, Grupo de Microeletrônica, Engenharia Elétrica, UFSM -
> Santa Maria, Brazil
>
> http://renanbirck.blogspot.com / skype: renan.ee.ufsm
>
>
> --
> 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

-- 
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


Re: [sage-support] Factors of an integer

2012-01-16 Thread Renan Birck Pinheiro
2012/1/16 Santanu Sarkar 

> Is there any function in Sage by which I can get the
> number of prime factors,  number of factors of a
> positive ineger?
>
> If I understand you correctly:

sage: factor(372)
2^2 * 3 * 31

One can get the number of factors by using 'len' on the result of this or
in tuples form by using 'list':

sage: len(factor(372))
3
sage: list(factor(372))
[(2, 2), (3, 1), (31, 1)]

Renan
-- 
Renan Birck Pinheiro, Grupo de Microeletrônica
, Engenharia
Elétrica , UFSM  - Santa Maria,
Brazil

http://renanbirck.blogspot.com / skype: renan.ee.ufsm

-- 
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


[sage-support] Factors of an integer

2012-01-16 Thread Santanu Sarkar
Is there any function in Sage by which I can get the
number of prime factors,  number of factors of a
positive ineger?

-- 
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