$$\int_{0}^{\pi}(\sin x)^{2n-2k+1}e^{a\cos x}dx$$ To avoid writing $n-k$ all the times let $v=n-k$. $$u=\cos x \implies du=-\sin x\,dx$$ $$\int_{-1}^{+1}(1-u^2)^{v} e^{au}du$$ Split the integral at 0 and we have, $$2\int_{0}^{1}(1-u^2)^{v}\cosh(au)du$$ (Because $\cosh x=\frac{e^a+e^{-a}}{2}$) $t=u^{2}\implies dt=2u\,du$ $$\int_{0}^{1}(1-t)^{v}\cosh(a\sqrt[2]{t})t^{\frac{-1}{2}}dt$$ Taylor series expansion of hyperbolic cosine gives us, $$\cosh(x)=\sum_{z\ge 0}\frac{x^{2z}}{(2z)!}$$ Placing this in the integrand and bringing the summation outside the integrand, $$\sum_{z\ge 0}\left(\frac{a^{2z}}{(2z)!}\int_{0}^{1}(1-t)^{(v+1)-1}t^{(z+1)-1}dt\right)$$ $$\sum_{z≥0}\frac{a^{2z}(B(z+1,v+1))}{(2z)!}$$$$\sum_{z\ge 0}\frac{a^{2z}(B(z+1,v+1))}{(2z)!}$$ Taking certain values of v$v$,a $a$ we can calculate the value of integrand by using properties of beta function. $$B(x,y)=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}$$ Having the values of $v,a\in\mathbb{Z}$ we can use the above the relation and simplify the summation.