The formula is:

(1 + x + x^2) / [(1 - x^3)^2]

The question itself asks for coefficient of x^100, which I have calculated by finding the corresponding pairs by splitting up the function, using the knowledge that
1/(1-x^3) = 1 + x^3 + x^6 + x^9 ..... and I got the answer to be 34.

However, I was wondering what if I was just looking for the coefficient of some x^n. How would I go about finding the closed formula for this? Because from my understanding if you have a closed formula you can find this...