How to prove this following formula?
$\sum_{k=1}^N(-1)^k(\cos \frac{k\pi}{N})^{N-m}(\sin\frac{k\pi}{N})^m=(-1)^{m/2}\frac{N}{2^{N-1}}$
for m is even, and $0$ for m is odd.
If we know $\sum_{k=1}^N(-1)^k(\cos\frac{k\pi}{N})^m=N/2^{N-1}$ for $m=N$, and $=-1/2(1-(-1)^{N+m})$ for $m<N$.
I have some ideas for this problem, but all fail. I tried Abel transformation or recursion. Maybe others ways can solve, like residual theory, but I'm not familiar with it. So I ask for help about this question.
From the given series, Abel transformation is easy to take. That is, one series is $(-1)^k*(\cos\frac{k\pi}{N})^{N-m}$ and the other is $(\sin\frac{k\pi}{N})^m$. But it doesn't work, because, I don't know the truncated sum for the first series, which is a necessary condition for Abel transformation calculation.
(Update on 20230224) I want to add some notes on the origin of these formulas. I encounter this identity when I want to calculate the witness for GHZ state as shown in doi:10.1103/PhysRevA.76.030305 and the following picture:
I hope this note would be helpful for future readers.

We seek to show that
$$S_{N,m} = \sum_{k=1}^N (-1)^k (\cos \frac{k\pi}{N})^{N-m} (\sin\frac{k\pi}{N})^m = \frac{1+(-1)^m}{2} (-1)^{m/2} \frac{N}{2^{N-1}}.$$
Observe that
$$\sum_{k=N+1}^{2N} (-1)^k (\cos \frac{k\pi}{N})^{N-m} (\sin\frac{k\pi}{N})^m \\ = \sum_{k=1}^N (-1)^{N+k} (-1)^{N-m} (\cos \frac{k\pi}{N})^{N-m} (-1)^m (\sin\frac{k\pi}{N})^m = S_{N,m}$$
so that
$$S_{N,m} = \frac{1}{2} \sum_{k=1}^{2N} (-1)^k (\cos \frac{k\pi}{N})^{N-m} (\sin\frac{k\pi}{N})^m.$$
With $\rho_k =\exp(k i\pi/N)$ the roots of $z^{2N}-1=0$ this becomes
$$\frac{1}{2} \sum_{k=1}^{2N} (-1)^k \frac{1}{2^{N-m}} (\rho_k+1/\rho_k)^{N-m} \frac{1}{2^m i^m} (\rho_k-1/\rho_k)^m.$$
Now introduce
$$f(z) = \frac{1}{2^{N+1} i^m} z^N (z+1/z)^{N-m} (z-1/z)^m \frac{2N/z}{z^{2N}-1}.$$
We then have by inspection that the sum is given by the residues due to the rational term at $\rho_k = \exp(k i\pi/N)$ with $1\le k\le 2N.$ Here we use that
$$\lim_{z\rightarrow\rho_k} \frac{z-\rho_k}{z^{2N}-1} = \frac{1}{2N \rho_k^{2N-1}}.$$
Note that should $z+1/z$ or $z-1/z$ be zero the corresponding trigonometric sum term would have been zero as well. In that case the simple pole from the rational term is canceled, making for a zero contribution and everything is in order. Continuing,
$$f(z) = \frac{N}{2^N i^m} \frac{1}{z} (z^2+1)^{N-m} (z^2-1)^m \frac{1}{z^{2N}-1}.$$
With residues adding to zero we must compute minus the residue at zero and minus the residue at infinity. We get for the former (including the switched sign)
$$\frac{N}{2^N i^m} (-1)^m.$$
and the latter (the residue at infinity is $-\mathrm{Res}_{z=0}\frac{1}{z^2} f\left(\frac{1}{z}\right)$)
$$\frac{N}{2^N i^m} \mathrm{Res}_{z=0} \frac{1}{z^2} z (1/z^2+1)^{N-m} (1/z^2-1)^m \frac{1}{1/z^{2N}-1} \\ = \frac{N}{2^N i^m} \mathrm{Res}_{z=0} \frac{1}{z} \frac{(z^2+1)^{N-m}}{z^{2N-2m}} \frac{(1-z^2)^m}{z^{2m}} \frac{z^{2N}}{1-z^{2N}} \\ = \frac{N}{2^N i^m} \mathrm{Res}_{z=0} \frac{1}{z} (z^2+1)^{N-m} (1-z^2)^m \frac{1}{1-z^{2N}} = \frac{N}{2^N i^m}.$$
Therefore we have
$$S_{N,m} = \frac{N}{2^N i^m} (-1)^m + \frac{N}{2^N i^m} = \frac{1+(-1)^m}{2} \frac{1}{i^m} \frac{N}{2^{N-1}}.$$
This is zero when $m$ is odd as claimed. When $m$ is even the term $1/i^m$ simplfies and we have at last
$$\frac{1+(-1)^m}{2} (-1)^{m/2} \frac{N}{2^{N-1}}$$
as desired.