2
$\begingroup$

Say I have a list

L = {0,1,2,4,6}

how can I form a power series with coefficients in L

x + 2x^2 + 4x^3 + 6x^4

?

$\endgroup$
7
  • 4
    $\begingroup$ (I'm sure this is a dupe, but I can't find the original.) Try Expand[FromDigits[Reverse[{0, 1, 2, 4, 6}], x]] $\endgroup$ Commented Feb 3, 2020 at 23:05
  • 1
    $\begingroup$ also L. x^Range[0, Length[L] - 1]? $\endgroup$
    – kglr
    Commented Feb 3, 2020 at 23:10
  • 1
    $\begingroup$ Or SeriesData[x, 0, L, 0, Length@L, 1] if someone wants a Series... $\endgroup$
    – Michael E2
    Commented Feb 3, 2020 at 23:36
  • $\begingroup$ @MichaelE2 - SeriesData[x, 0, L, 0, Length@L, 1] // Normal for polynomial $\endgroup$
    – Bob Hanlon
    Commented Feb 3, 2020 at 23:41
  • 1
    $\begingroup$ @Bernoulli - don't ask new questions in comments. Also, when asking the new question you must include the definition of p for anyone to understand why you are getting an expansion. $\endgroup$
    – Bob Hanlon
    Commented Feb 3, 2020 at 23:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.