Does this help?

sage: n=factorial(30)
sage: [Factorization([pe]) for pe in n.factor()]
[2^26, 3^14, 5^7, 7^4, 11^2, 13^2, 17, 19, 23, 29]


sage: x = polygen(GF(3))
sage: f = cyclotomic_polynomial(120)(x)
sage: [Factorization([pe]) for pe in f.factor()]

[(x^4 + x^2 + x + 1)^2,
 (x^4 + x^2 + 2*x + 1)^2,
 (x^4 + x^3 + x^2 + 1)^2,
 (x^4 + 2*x^3 + x^2 + 1)^2]

John Cremona

On Dec 3, 9:57 am, Tim Lahey <[EMAIL PROTECTED]> wrote:
> On Dec 3, 2008, at 4:50 AM, Simon King wrote:
>
>
>
>
>
> > Dear Tim,
>
> > On Dec 3, 7:15 am, Tim Lahey <[EMAIL PROTECTED]> wrote:
> > <snip>
> >> No, because I want instead of something like
> >> [(x-2,2),(x-3,3)]
>
> >> I'd like
> >> [(x-2)^2,(x-3)^3]
>
> > You may do this:
> > Start with a factorization of something:
> >    sage: f=factor(16200)
> >    sage: f
> >    2^3 * 3^4 * 5^2
>
> > "for X in f" means that X runs over the pairs (2,3), (3,4), (5,2). And
> > out of such pairs you can construct a factorization for each prime
> > power, i.e.:
> >    sage: [Factorization([X]) for X in f]
> >    [2^3, 3^4, 5^2]
> > Is this what you wanted?
>
> Yes, and it's what someone else told me earlier in this thread. However,
> in the case of polynomials one has to be careful that it isn't expanded
> when raising to the power.
>
> Thanks,
>
> Tim.
>
> ---
> Tim Lahey
> PhD Candidate, Systems Design Engineering
> University of Waterloohttp://www.linkedin.com/in/timlahey
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to