# Generating function

1. Dec 27, 2011

### Emilijo

Does exist general formula for nth term in sequence if I have generative function?
In my case, generative function is (1/(1-x))-(1/(1-x^3)).

2. Dec 27, 2011

### ramsey2879

I think so but you may have to give the 1st 3 terms and the generating function.

3. Dec 27, 2011

### Emilijo

I don't have to give 1st 3 terms. If I have generating function, the sequence is strictly given, and I just want to have formula for getting nth term in the sequence.
Now, what is the formula?(general formula, and formula for my case)

4. Dec 27, 2011

### epsi00

Emilio, there is a simple rule that people asking for help should know. If people who are willing to help ask for something, you better provide it if you want their help. Reading your answer motivates people not to answer your question. Arrogance does not help.

5. Dec 27, 2011

### pwsnafu

Nonsense. There are different types of generating functions: "ordinary generating functions", "exponential generating function", "Dirchlet generating functions" and so on. They each have own rules for manipulation (especially multiplication), and what you need to do to obtain the individual terms is different. Just telling us "here is a generating function" gives no information about the underlying series.

More to the point, that process is directly obtained from the definition of the generating function you are using. It's the same process of obtaining terms from a Taylor series. If you have not studied generating functions before then I suggest you read Generatingfunctionology. It's free off the web.

6. Dec 27, 2011

### epsi00

7. Jan 13, 2012

### pablis79

The sequence you give has the Taylor series coefficient function 4/3Sin(Pi*n/3)^2, which may simplify further given n is an integer.

If you want a general form for the coefficients of a generating function, you can use an contour integral from complex analysis which extracts the coefficient:

$\frac{1}{2\pi i}\oint_{|z|<1}\frac{f(z)}{z^{n+1}}dz$,

where f(z) is your generating function, and n is the element index in the sequence you are trying to obtain. You can use the substitution $z=e^{iy}$ with the new limits $y=0$ and $y=2\pi$ to compute the integral.

This can be more useful than the Taylor approach sometimes, but as has been said before generating functions come in many different forms, and it is best to learn the art in general really. You may find that if your generating function has no "nice" pattern to it, then you cannot find a sequence function (e.g. 2 + 3x + 5x^2 + 7x^3 + 11x^4 + ... + p_n x^n + ..., where p_n is the n-th prime)