The following list has a length only 10 (not 11)
CoefficientList[Series[ArcTan[x]/(1-x^2),{x,0,10}],x]
{0, 1, 0, 2/3, 0, 13/15, 0, 76/105, 0, 263/315}
It should be
{0, 1, 0, 2/3, 0, 13/15, 0, 76/105, 0, 263/315, 0}
Compare with
CoefficientList[Series[ArcTan[x]/(1-x),{x,0,10}],x]
{0, 1, 1, 2/3, 2/3, 13/15, 13/15, 76/105, 76/105, 263/315, 263/315}
(length of the list is 11)
This is important for an exponential generating functions. Correct is
nmax=10; CoefficientList[Series[ArcTan[x]/(1-x), {x, 0, nmax}], x] * Range[0, nmax]!
{0, 1, 2, 4, 16, 104, 624, 3648, 29184, 302976, 3029760}
But from
nmax=10; CoefficientList[Series[ArcTan[x]/(1-x^2), {x, 0, nmax}], x] * Range[0, nmax]!
we get an error:
"Objects of unequal length ... cannot be combined"
Possible solution is add a missing zero manually, for example:
nmax=10; Flatten[{CoefficientList[Series[ArcTan[x]/(1-x^2), {x, 0, nmax}], x] ,0}] * Range[0, nmax]!
{0, 1, 0, 4, 0, 104, 0, 3648, 0, 302976, 0}
Added after an answer by Mr.Wizard:
Yes, this is a nice solution (and independent on lenght of list), thank you!. For the final sequence we have:
nmax=10; Coefficient[Series[ArcTan[x]/(1-x^2),{x,0,nmax}],x,Range[0,nmax]]*Range[0,nmax]!
{0,1,0,4,0,104,0,3648,0,302976,0}
But question is, if is also efficient. For big "nmax" is much faster
CoefficientList[Series[f[x], {x, 0, nmax}], x] * Range[0, nmax]!
than
Table[n!*SeriesCoefficient[f[x],{x,0,n}], {n,0,nmax}]
seriesCoefficientList. – Mr.Wizard May 22 '15 at 11:37I tried also (each with a restart of Mathematica)
– Vaclav Kotesovec May 22 '15 at 11:56CoefficientListcan take a third argument indicating a total length, and will pad out with zeros to meet that length. This can be used to enforce that the lists being multiplied have the same length. – Daniel Lichtblau May 22 '15 at 18:53CoefficientListbe documented. – Daniel Lichtblau May 23 '15 at 22:48