a. By the binomial theorem,
[tex]\displaystyle\left(x^2+\frac1x\right)^n=\sum_{k=0}^n\binom nk(x^2)^{n-k}\left(\frac1x\right)^k=\sum_{k=0}^n\binom nkx^{2n-3k}[/tex]
which produces a constant term when [tex]2n-3k=0[/tex], or [tex]2n=3k[/tex]. [tex]2n[/tex] is even for any choice of [tex]n[/tex], so [tex]n[/tex] must be any positive integer for which [tex]2n[/tex] is an even multiple of 3 i.e. a multiple of 6. Then [tex]n[/tex] can be any of the integers in the sequence {6, 12, 18, ...}.
b. Let [tex]n=6m[/tex] for some positive integer [tex]m[/tex]. Then
[tex]\displaystyle\left(x^2+\frac1x\right)^{6m}=\sum_{k=0}^{6m}\binom {6m}k(x^2)^{6m-k}\left(\frac1x\right)^k=\sum_{k=0}^{6m}\binom{6m}kx^{12m-3k}[/tex]
and the constant term occurs when [tex]12m-3k=0[/tex], or [tex]4m-k=0[/tex], or [tex]k=4m[/tex]. At this value of [tex]k[/tex], we get the term
[tex]\dbinom{6m}{4m}x^{12m-3(4m)}=\dfrac{(6m)!}{(4m)!(6m-4m)!}=\dfrac{(6m)!}{(4m)!(2m)!}[/tex]