Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: extracting powers and coefficients from a polynomial

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49070] Re: extracting powers and coefficients from a polynomial
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 30 Jun 2004 05:34:16 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <cbrcau$iqc$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,


expr = Expand[(Sum[x^i, {i, 6}])^3];

MapIndexed[{#2[[1]] - 1, #1} &, CoefficientList[expr, x]] /. {_, 0} :> 
    Sequence[]//TableForm


Regards
  Jens

AngleWyrm wrote:
> 
> I have made a formula that produces a polynomial expansion, and I wish to
> extract the powers and coefficients into a list.
> 
> Expand[(Sum[x^i, {i, 6}])^3]
>   1x^3 + 3x^4 + 6x^5 + 10x^6 + 15x^7 + 21x^8 + 25x^9 + 27x^10 + 27x^11 + 25x^12
> + 21x^13 + 15x^14 + 10x^15 + 6x^16 + 3x^17 + 1x^18
> 
> How do I make a table of the powers and coefficents?
> 3, 1
> 4, 3
> 5, 6
> 6, 10
> ....
> 
> --
> AngleWyrm
> The C++ hat random selection container:
> http://home.comcast.net/~anglewyrm/hat.html


  • Prev by Date: MATHEMATICA AND FINANCIAL CALCULATIONS?
  • Next by Date: Re: extracting powers and coefficients from a polynomial
  • Previous by thread: Re: extracting powers and coefficients from a polynomial
  • Next by thread: Re: extracting powers and coefficients from a polynomial