Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

Is there a built-in function that will find a general expression for the coefficient of the series expansion of a function?

Series will only give the explicit terms up to some order

In[14]:= Series[Exp[x],{x,0,10}]
Out[14]= 1+x+x^2/2+x^3/6+x^4/24+x^5/120+x^6/720+x^7/5040+x^8/40320+x^9/362880+x^10/3628800+O[x]^11

And GeneratingFunction works the other way:

In[15]:= GeneratingFunction[1/n!,n,x]
Out[15]= E^x

I'm looking for something like the inverse of GeneratingFunction: start with Exp[x] and get 1/n!. Does it exist?

share|improve this question
    
Also FindSequenceFunction[] isn't very clever ... at least in V8. Has it been improved in v9? –  belisarius Mar 20 '13 at 2:47
    
    
@belisarius. V9.0.1 docs indicate FindSequenceFunction has not been modified since its introduction into V7. –  m_goldberg Mar 20 '13 at 8:14
add comment

marked as duplicate by J. M. May 9 '13 at 5:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 17 down vote accepted

In this case you can use SeriesCoefficient

SeriesCoefficient[Exp[x], {x, 0, n}]
share|improve this answer
    
Thanks! I can't believe I spent 20 minutes looking and I didn't see this ... For some reason I was convinced it's only for SeriesCoefficient[Series[...], ...]. –  Szabolcs Mar 20 '13 at 2:49
add comment

There is another approach that sometimes works better (gives closed-form expressions rather than recurrence relations):

In[1]:= InverseFourierTransform[(-I k)^n FourierTransform[1/(1 + x^2)^Log[2], x, k] , k, x]
Out[1]= (2^(-1 + n - 1/2 Log[1/x^2])
      Abs[x]^-Log[2] ((-I)^
      n ((1 + n) x Gamma[(1 + n)/2] Gamma[
      n/2 + Log[2]] Hypergeometric2F1[(1 + n)/2, n/2 + Log[2], 1/
      2, -x^2] (n + Log[4]) - 
    2 I Gamma[1 + n/2] Gamma[
      1/2 (1 + n + Log[4])] ((1 + x^2) Hypergeometric2F1[(2 + n)/
         2, 1/2 (1 + n + Log[4]), -(1/2), -x^2] - 
       Hypergeometric2F1[(2 + n)/2, 1/2 (1 + n + Log[4]), 1/
         2, -x^2] (1 + x^2 (3 + 2 n + Log[4])))) + 
 I^n ((1 + n) x Gamma[(1 + n)/2] Gamma[
      n/2 + Log[2]] Hypergeometric2F1[(1 + n)/2, n/2 + Log[2], 1/
      2, -x^2] (n + Log[4]) + 
    2 I Gamma[1 + n/2] Gamma[
      1/2 (1 + n + Log[4])] ((1 + x^2) Hypergeometric2F1[(2 + n)/
         2, 1/2 (1 + n + Log[4]), -(1/2), -x^2] - 
       Hypergeometric2F1[(2 + n)/2, 1/2 (1 + n + Log[4]), 1/
         2, -x^2] (1 + x^2 (3 + 2 n + Log[4]))))))/((1 + n) 
       Sqrt[Pi] x Gamma[Log[2]] (n + Log[4]))

It also can be used to find repeated anti-derivatives.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.