Here's my question:
What values/restrictions of $n$ give a constant term in the expansion of $$\left(\frac{1}{x^2}+x\right)^n$$? Also, for the expansions that do have a constant term, what is this constant term(in terms of $n$)?
It seems as if only multiples of $3$ work for the values of $n$ based on the different values I have tested but I don't know how to approach a problem like this. Maybe binomial theorem? For the constant term, I have $3$ for $n=3$, $15$ for $n=6$, and $84$ for $n=9$. $3=\binom{3}{1}$, $15=\binom{6}{2}$, and $84=\binom{9}{3}$, so that makes me conclude that the constant term is $\binom{n}{n/3}$. How would I do this mathematically? What method should I use? Thanks in advance.
(I used symbolab.com for testing btw)
You should indeed use binomial theorem. The terms of the expansion, for $k = 0, \ldots, n$, will be $$\binom{n}{k}\left(\frac{1}{x^2}\right)^k x^{n - k} = \binom{n}{k}x^{n - 3k}.$$ You get a (non-zero) $x^0$ term if and only if there exists some $k$ such that $n - 3k = 0$, i.e. when $n$ is divisible by $3$. As you hypothesised, this happens when $k = n/3$, so the constant term is $$\binom{n}{n/3},$$ or $0$ when $n$ is not divisible by $3$.