# Algorithms for Various Trigonometric Power Sums
## 5 Twisted Trigonometric Power Sums
From the output, we observe that the behavior of the trigonometric power sum is mainly dominated by the number-theoretical term in (68). One can check the above result for \(V^{-}_{9,12,2}(m)\) by setting \(m\) equal to specific values. Before this can be accomplished, one must first create a function out of the final value as follows:  
\( \begin{array}{l}\text{Q}[m.]\text{:= }28736191507522589/194896477400625-219\ (-1)^{m}+2\Big{(}\dfrac{5}{64}\left(-1-(-1)^{m}\right)+\\ \dfrac{5}{64}(1+(-1)^{m})\Big{)}-12\Big{(}(-1)^{m}+2\Big{(}\dfrac{3}{8}\Big{(} -1-(-1)^{m}\Big{)}+\dfrac{3}{8}\Big{(}1+(-1)^{m}\Big{)}\Big{)}\Big{)}+\\ 66\Big{(}(-1)^{m}+2\Big{(}\dfrac{1}{4}(-1-(-1)^{m})+\dfrac{1}{2}(1+(-1)^{m}) \Big{)}\Big{)}-\dfrac{51766106m^{2}}{328185}+\\ \dfrac{4946109824m^{4}}{50675625}-\dfrac{1794850075988m^{6}}{40226311125}+ \dfrac{559016662m^{8}}{35083125}-\dfrac{10363664m^{10}}{2338875}+\\ \dfrac{187005175216m^{12}}{201131555625}-\dfrac{12646904m^{14}}{91216125}+ \dfrac{33862354m^{16}}{2584456875}-\dfrac{22998766228m^{18}}{38979295480125}.\end{array} \)  
By putting \(m=10\) in the above polynomial, one finds that  
In[25]:= Q[10]  
\(\text{Out}[25]=-\dfrac{294987411105763646}{625}.\)  
In number form or to machine precision, Mathematica prints out In[26]:= NumberForm[\(-4.7198\times 10^{14}\), 16] Out[26]//NumberForm = \(-4.719798577692218\times 10^{14}\). On the other hand, for \(m\) equal to an odd value, say 11, one finds that \(Q[11]\) gives a value of  
In[27]:= Q[11] Out[27] = \(-\frac{30011175790744604}{11}\). In decimal form to 16 places, the above value becomes \(-2.7282887082495095\times 10^{15}\). Since the above trigonometric power sum can be expressed as  
\[V_{9,12,2}^{-}(m)=\sum_{k=1}^{2m-1}(-1)^{k}\cos^{24}\Big{(}\frac{k\pi}{2m} \Big{)}\csc^{18}\Big{(}\frac{k\pi}{2m}\Big{)}, \tag{89}\]  
it can also be expressed in terms of the standard instructions in Mathematica as  
\(\mathrm{VSum[m_{-}]:=Sum[(-1)^{\wedge}k\ Cos[k\ Pi/(2\ m)]^{\wedge}(24)\csc[k\ Pi/(2\ m)]^{\wedge}(18),\ [k,\,1,\,2\ m-1]]}\). Putting \(m=10\) in the above form for \(V_{9,12,2}^{-}(m)\) yields  
In[28]:= VSum[10]  
\[-\frac{1}{4}+\frac{(-1-\sqrt{5})^{24}}{281474976710656(5/8-\sqrt{5}/8)^{9}}+ \frac{(1-\sqrt{5})^{24}}{281474976710656(5/8+\sqrt{5}/8)^{9}}+\]  
\[2\Big{(}\frac{5}{8}-\frac{\sqrt{5}}{8}\Big{)}^{12}\big{(}-1+\sqrt{5}\big{)}^{18 }+\frac{(-1+\sqrt{5})^{24}}{281474976710656(5/8+\sqrt{5}/8)^{9}}+\]  
\[2\Big{(}\frac{5}{8}+\frac{\sqrt{5}}{8}\Big{)}^{12}\big{(}1+\sqrt{5}\big{)}^{18 }+\frac{(1+\sqrt{5})^{24}}{281474976710656(5/8-\sqrt{5}/8)^{9}}-\]  
\[2\cos^{6}\Big{(}\frac{\pi}{20}\Big{)}\cot^{18}\Big{(}\frac{\pi}{20}\Big{)}-2 \cos^{6}\Big{(}\frac{3\pi}{20}\Big{)}\cot^{18}\Big{(}\frac{3\pi}{20}\Big{)}-2 \sin^{6}\Big{(}\frac{\pi}{20}\Big{)}\tan^{18}\Big{(}\frac{\pi}{20}\Big{)}-\]  
\[2\sin^{6}\Big{(}\frac{3\pi}{20}\Big{)}\tan^{18}\Big{(}\frac{3\pi}{20}\Big{)}.\]  
If one asks for the number form value of the above expression to 16 decimal places, then Mathematica yields the following result:  
In[29]:= NumberForm[\(-4.7198\times 10^{14}\), 16] Out[29]//NumberForm = \(-4.719798577691239\times 10^{14}\). Therefore, we obtain the same numerical value as the algorithm for \(V_{9,12,2}^{-}(10)\) except for the last few decimal places, which is due to the fact that the above method has implemented far more machine precision. Moreover, if we set \(m\!=\!11\) in VSum, then we obtain a similar expression in products of power of trigonometric functions as displayed above, but with no algebraic terms. In this instance, the denominators of the arguments of the trigonometric functions are either 11 or 22. In number form to 16 decimal places, we find that VSum[11] equals \(-2.7282887082496685\times 10^{15}\), which equals Q[11] to 13 decimal places. Now that we have created an algorithm for \(V^{\pm}(v,j,1)(m)\), we can turn our attention to the creation of an algorithm for the general twisted trigonometric power sum defined in the introduction. This is accomplished in the following theorem. **Theorem 2**.