# Algorithms for Various Trigonometric Power Sums
## 5 Twisted Trigonometric Power Sums
Lemma 2: _For \(j<v\), the trigonometric power sum defined by (65) can be expressed as_  
\[V^{\pm}_{v,j,l}(m)=\sum_{i=0}^{j}(-1)^{i}\binom{j}{i}\sum_{n=0}^{v-i-1}\frac{s(v -i,n)}{(2v-2i-2n)_{2n}}\frac{\zeta(2v-2i-2n)}{\pi^{2v-2i-2n}}\ Sf(v-i,n,\pm 1,l), \tag{67}\]  
_where the summand factors, \(Sf(v-i,n,\pm,l)\) are displayed in Table 6 for both signs in the Dowker and Gardner-Fisher cases._  
_For \(j\geq v\), \(V^{\pm}_{v,j,l}(m)\) is given by_  
\[V^{\pm}_{v,j,l}(m) =\sum_{i=0}^{v-1}(-1)^{i}\binom{j}{i}\sum_{n=0}^{v-i-1}\frac{s(v-i,n)}{(2v-2i-2n)_{2n}}\frac{\zeta(2v-2i-2n)}{\pi^{2v-2i-2n}}\ Sf(v-i,n,\pm 1,l)\] \[\quad+l\sum_{i=v+1}^{j}(-1)^{i}\binom{j}{i}S^{\pm}_{0,l}(i-v,m)- \frac{(\pm 1)^{m}}{2}\left(-1\right)^{v}\left(1+(-1)^{l}\right)\binom{j-1}{v}\] \[\quad+(-1)^{v}P(\pm 1,l)\binom{j}{v}, \tag{68}\]  
_where \(S^{+}_{0,1}(i-v,m)\), \(S^{+}_{0,2}(i-v,m)\), \(S^{-}_{0,1}(i-v,m)\) and \(S^{-}_{0,2}(i-v,m)\) are, respectively, given by (81), (82), (49) and (51), while the various \(m\)-dependent values of \(P(\pm 1,l)\) are displayed in Table 7. In addition, \(\delta_{l,2}\) denotes the Kronecker delta, which equals unity only when \(l=2\) or in the Gardner-Fisher case._  
Proof: When \(j<v\), all the sine powers in (66) are negative. Consequently, the results of Sections 2 and 3 can be used to evaluate \(V^{\pm}_{v,j,l}\). For \(l=1\) and the non-alternating case, we introduce (15) into (66), which gives  
\[V^{+}_{v,j,1}(m)=2\sum_{i=0}^{j}(-1)^{j}\binom{j}{i}\sum_{n=0}^{v-i-1}\frac{s (v-i,n)}{(2v-2i-2n)_{2n}}\frac{\zeta(2v-2i-2n)}{\pi^{2v-2i-2n}}\left(m^{2v-2i- 2n}-1\right). \tag{69}\] \begin{table}
\begin{tabular}{c c c} \hline \hline _sgn_ & \(l\) & \(Sf(v,n,sgn,l)\) \\ \hline \(1\) & \(1\) & \(2^{2n+1}(m^{2v-2n}-1)\) \\ \(1\) & \(2\) & \(2^{2n+1}(m^{2v-2n}-1)\) \\ \(-1\) & \(1\) & \(2^{2n}((2^{2n-2v+1}-1)m^{2v-2n}-1)\big{(}1+(-1)^{m}\big{)}\) \\ \(-1\) & \(2\) & \((2^{2n+2}-2^{2v+1})m^{2v-2n}-(-1)^{m}2^{2v+1}+((-1)^{m}-1)2^{2n+1}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Summand factors for the inverse powers of sine in \(V^{\pm}_{v,j,l}(m)\). \begin{table}
\begin{tabular}{c c c} \hline \hline _sgn_ & \(l\) & \(P(sgn,l)\) \\ \hline \(1\) & \(1\) & \(m-1\) \\ \(1\) & \(2\) & \(2m-1\) \\ \(-1\) & \(1\) & \(\begin{cases}-1,&m\text{even}\\ 0,&m\text{odd}\end{cases}\) \\ \(-1\) & \(2\) & \(-1\) \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Factors \(P(\pm 1,l)\) in the \(j=v\) term of \(V^{\pm}_{v,j,l}(m)\). On the other hand, for the Gardner-Fisher case, where \(l=2\), we note that  
\[\sum_{k=1}^{2m-1}\sin^{2i-2v}\Bigl{(}\frac{k\pi}{2m}\Bigr{)}=2\sum_{k=1}^{m-1}\sin ^{2i-2v}\Bigl{(}\frac{k\pi}{2m}\Bigr{)}+1. \tag{70}\]  
Therefore, we can replace the sum on the rhs of (66) by \(2S^{+}_{v,2}(m)+1\). Since \(S^{+}_{v,2}(m)\) is given by (11), we arrive at  
\[V^{+}_{v,j,2}(m)=\sum_{i=0}^{j}(-1)^{i}\binom{j}{i}\sum_{n=0}^{v-i-1}\frac{s(v -i,n)}{(2v-2i-2n)_{2n}}\frac{\zeta(2v-2i-2n)}{\pi^{2v-2i-2n}}\left(\frac{m^{2v- 2i-2n}-1}{2^{2v-2i-2n}-1}\right), \tag{71}\]  
where the contribution from the term of unity on the rhs of (70) vanishes courtesy of the binomial theorem. When the summand alternates in sign, i.e., for \(V^{-}_{v,j,l}(m)\), we still have a purely cosecant power sum, but now the results in Section 3 apply. For the Dowker case, we introduce (17) into (66). Thus, we arrive at  
\[V^{-}_{v,j,1}(m)=\sum_{i=0}^{j}(-1)^{i}\binom{j}{i} \begin{cases}0,\\ \sum_{n=0}^{v-i-1}\frac{s(v-i,n)}{(2v-2i-2n)_{2n}}\frac{\zeta(2v-2i-2n)}{\pi^{ 2v-2i-2n}}\\ \times\end{cases}  \tag{72}\]  
For \(V^{-}_{v,j,2}(m)\), however, we need to take note of the fact that  
\[\sum_{k=1}^{2m-1}(-1)^{k}\sin^{2i-2v}\Bigl{(}\frac{k\pi}{2m}\Bigr{)}=2S^{-}_{v -i,2}(m)+(-1)^{m}, \tag{73}\]  
where \(S^{-}_{v-i,2}(m)\) is defined by (16).