# Algorithms for Various Trigonometric Power Sums
## 5 Twisted Trigonometric Power Sums
Now, by introducing (18) into (66), one obtains  
\[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}}\] \[\qquad\times\Bigl{(}\bigl{(}2^{2n+2}-2^{2v-2i+1}\bigr{)}m^{2v-2i- 2n}-(-1)^{m}\,2^{2v-2i+1}+\bigl{(}(-1)^{m}-1\bigr{)}2^{2n+1}\Bigr{)}. \tag{74}\]  
Similarly to the term of unity in the non-alternating case, the resulting sum arising from the constant of \((-1)^{m}\) in (73) vanishes due to the binomial theorem. From these results, we see that the sums over \(n\) have a common term of \(s(v-i,n)\zeta(2v-2i-2n)/(2v-2i-2n)_{2n}\pi^{2v-2i-2n}\). Hence, the sums can be expressed as this term multiplied by a summand factor, \(Sf(v,n,sgn,l)\), for each value of \(sgn\) in both the Dowker and Gardner-Fisher cases. By adopting this approach, we arrive at (67), where the summand factors are displayed in Table 6. These results have been obtained from (11), (15), (17) and (18), bearing in mind that, in the Gardner-Fisher cases, there is an extra factor of \(2\), as indicated by (70) and (73). Furthermore, since the above results for \(V^{\pm}_{v,j,l}(m)\) depend on the Riemann zeta function, they are purely number-theoretical. When \(j\geq v\), however, the situation changes. Then, (66) becomes  
\[V^{\pm}_{v,j,l}(m) =\sum_{i=0}^{v-1}(-1)^{i}\binom{j}{i}\sum_{k=1}^{ln-1}(\pm 1)^{k} \csc^{2v-2i}\Bigl{(}\frac{k\pi}{lm}\Bigr{)}+(-1)^{v}\binom{j}{v}\sum_{k=1}^{ ln-1}(\pm 1)^{k}\] \[+\sum_{i=v+1}^{j}(-1)^{i}\binom{j}{i}\sum_{k=1}^{ln-1}(\pm 1)^{ k}\sin^{2i-2v}\Bigl{(}\frac{k\pi}{lm}\Bigr{)}. \tag{75}\]  
The first term on the rhs of (75) is number-theoretical as in the \(j<v\) case, except the upper limit is \(v-1\), not \(j\). Consequently, the earlier results in the proof can be applied here except the summation over \(i\) has an upper limit of \(v-1\). The next term on the rhs is the \(j=v\) term, which has been isolated or separated to avoid any potential problem concerning the determinacy of the zeroth power of the sine in Mathematica. For \(l\!=\!1\) and the positive-sign or non-alternating case, the sum over \(k\) equals \(m-1\). However, for \(l\!=\!1\) and the negative-sign or alternating case, the sum over \(k\) vanishes when \(m\) is odd, but equals \(-1\) when \(m\) is even. For the Gardner-Fisher case, the sum over \(k\) equals \(2m-1\) for \(sgn=+1\) and \(-1\) for \(sgn=-1\). We shall represent the latter sums over \(k\) for the various values of the sign and \(l\) by \(P(\pm 1,l)\). Hence, the second term on the rhs of (75) can be represented by \((-1)^{v}P(\pm 1,l)\binom{j}{v}\), where the various values of \(P(\pm 1,l)\) appear in Table 7.  
The final term on the rhs of (75) represents a sum over basic sine power sums. It also vanishes when \(j=v\). From the previous section, we have seen that these sums yield combinatorial results. For \(j\) close to \(v\), the first sum on the rhs of (75) dominates. Hence, we expect that the overall results will be mainly number-theoretical in nature when \(j\) is approximately equal to \(v\). This applies especially to the alternating Dowker case because, as we shall see, the sum over the basic sine power sums vanishes when coded as a program. For the Dowker or \(l\!=\!1\) case, the final term on the rhs of (66) can be expressed as  
\[\sum_{i=v+1}^{j}(-1)^{i}\binom{j}{i}\sum_{k=1}^{m-1}(\pm 1)^{k}\sin^{2i-2n} \Bigl{(}\frac{k\pi}{m}\Bigr{)}=\sum_{i=v+1}^{j}(-1)^{i}\binom{j}{i}S_{0,1}^{ \pm}(i-v,m). \tag{76}\]  
On the other hand, in the Gardner-Fisher case, we have to split the sum over \(k\) into two separate sums, since the upper limit is \(2m-1\) for \(V_{v,j,2}^{\pm}(m)\). In terms of \(S_{0,2}^{\pm}(i,m)\), the sum can be expressed as  
\[\sum_{k=1}^{2m-1}(\pm 1)^{k}\sin^{2i}\Bigl{(}\frac{k\pi}{2m}\Bigr{)}=2S_{0,2}^{ \pm}(i,m)+(\pm 1)^{m}, \tag{77}\]  
which is identical to the inverse power cases given by (70) and (73).