MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Factorising polynomials

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63993] Re: [mg63970] Factorising polynomials
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 26 Jan 2006 03:43:44 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

data=Factor[x^Range[6]+1];

If[#===Expand[#],1,Length[#]]&/@data

{1,1,2,1,2,2}

If[FreeQ[#,Times],1,Length[#]]&/@data

{1,1,2,1,2,2}


Bob Hanlon

> 
> From: "Tony King" <mathstutoring at ntlworld.com>
To: mathgroup at smc.vnet.net
> Subject: [mg63993] [mg63970] Factorising polynomials
> 
> I am trying to find the number of irreducible polynomials over the integers 
> in the factorisation of x^n+1
> 
> I used the following code
> 
> data = Factor[x^# + 1] & /@ Range[6]
> 
> Followed by
> 
> Table[Length[data[[k]]], {k, 1, 6}]
> 
> And Mathematica returned {2,2,2,2,2,2}, one assumes because it was 
counting 
> terms such as 1+x as 2 terms. However, when the number of factors 
exceeds 1, 
> Mathematica returns them as a list and counts them correctly. The output 
> that I was looking for should have been {1,1,2,1,2,2}.
> 
> Does anyone have any ideas how I might modify the above code so that it 
> returns the correct number of terms
> 
> Many thanks
> 
> Tony
> 
> 


  • Prev by Date: Re: Factorising polynomials
  • Next by Date: Re: Mathematica 5.2 multithreading using Debian
  • Previous by thread: Re: Factorising polynomials
  • Next by thread: Re: Factorising polynomials