[R] how can I get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3

Spencer Graves spencer.graves at pdf.com
Sat Dec 4 03:08:12 CET 2004


      Have you considered library(polynom)?  If you don't already have 
it but have R, install.packages("polynom") should get it. 

      hope this helps.  spencer graves

Peter Yang wrote:

>Hi, 
>
> 
>
>I would like to get the coefficients of x^0, x^1, x^2,  . , x^6 from
>expansion of (1+x+x^2)^3.
>
>The result should be 1, 3, 6, 7, 6, 3, 1; 
>
> 
>
>How can I calculate in R? 
>
> 
>
>You help will be greatly appreciated.
>
> 
>
>Peter 
>
> 
>
> 
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>  
>

-- 
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567




More information about the R-help mailing list