Browse Groups

• Sorry bout this but I just can t find some obvious things in the PARI manual, I hope I didn t miss it... Anyway: the easy instruction factor(N) yeilds a
Message 1 of 2 , Jul 8, 2006
View Source
Sorry 'bout this but I just can't find some obvious things in the PARI manual, I hope I didn't miss it...

Anyway: the easy instruction "factor(N)" yeilds a matrix. What function will tell me just the length and width of the matrix? The length should always be 2 but the width will be the number of different factors.

Roahn

[Non-text portions of this message have been removed]
• ... The factor(N) function returns a matrix with W rows, where W is the number of distinct prime factors of N and each row consists of two elements -- the
Message 1 of 2 , Jul 8, 2006
View Source
> Sorry 'bout this but I just can't find some obvious things in the PARI
> manual, I hope I didn't miss it...
>
> Anyway: the easy instruction "factor(N)" yeilds a matrix. What function
> will tell me just the length and width of the matrix? The length should
> always be 2 but the width will be the number of different factors.

The factor(N) function returns a matrix with W rows, where W is the number
of distinct prime factors of N and each row consists of two elements --
the prime and its exponent in factorization of N. W itself can be found
using the function omega(N).

However, if you have already computed the factorization of N, it might be
much faster to use matsize(A) function, which returns the dimensions of
matrix A as a two-element vector (so that you can use matsize(A)[1] or
matsize(A)[2] to get your "width" and "length").

Peter

--
[Name] Peter Kosinar [Quote] 2B | ~2B = exp(i*PI) [ICQ] 134813278
Your message has been successfully submitted and would be delivered to recipients shortly.
• Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
• Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer. We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.