# Algorithms for Various Trigonometric Power Sums
## 2 Background
\begin{table}
\begin{tabular}{l l} \hline \(n\) & \(c_{\rho,n}\) \\ \hline
0 & 1 \\
1 & \(\frac{1}{3}\,\,\rho\) \\
2 & \(\frac{2}{6}\,\,\bigl{(}2\rho+5\rho^{2}\bigr{)}\) \\
3 & \(\frac{8}{9}\,\,\bigl{(}16\rho+42\rho^{2}+35\rho^{3}\bigr{)}\) \\
4 & \(\frac{2}{3\times 10}\,\,\bigl{(}144\rho+404\rho^{2}+420\rho^{3}+175\rho^{4} \bigr{)}\) \\
5 & \(\frac{3}{3\times 12}\,\,\bigl{(}768\rho+2288\rho^{2}+2684\rho^{3}+1540\rho^{4}+ 385\rho^{5}\bigr{)}\) \\
6 & \(\frac{2}{9\times 15}\,\,\bigl{(}1061376\rho+3327594\rho^{2}+4252248\rho^{3}+2862860 \rho^{4}+1051050\rho^{5}+175175\rho^{6}\bigr{)}\) \\
7 & \(\frac{27}{27\times 15!}\,\,\bigl{(}552960\rho+1810176\rho^{2}+2471456\rho^{3}+1849 848\rho^{4}+820820\rho^{5}+210210\rho^{6}\) \\  & \(+25025\rho^{7}\bigr{)}\) \\
8 & \(\frac{2}{45\times 18!}\,\,\bigl{(}200005632\rho+679395072\rho^{2}+978649472 \rho^{3}+792548432\rho^{4}+397517120\rho^{5}\) \\  & \(+125925800\rho^{6}+23823800\rho^{7}+2127125\rho^{8}\bigr{)}\) \\
9 & \(\frac{4}{81\times 211}\,\,\bigl{(}129369047040\rho+453757851648\rho^{2}+68352687385 6\rho^{3}+58915364352\rho^{4}\) \\  & \(+323159810064\rho^{5}+117327450240\rho^{6}+27973905960\rho^{7}+4073869800\rho^{8 }+282907625\rho^{9}\bigr{)}\) \\
10 & \(\frac{2}{607\times 5^{2}2!}\,\,\bigl{(}38930128699392\rho+140441050828800\rho^{2}+219 792161825280\rho^{3}+199416835425280\rho^{4}\) \\  & \(+117302530691808\rho^{5}+47005085727600\rho^{6}+12995644662000\rho^{7}+242201259 3000\rho^{8}\) \\  & \(+280078548750\rho^{9}+15559919375\rho^{10}\bigr{)}\) \\ \hline \end{tabular}
\end{table} 
Table 1: Generalized cosecant numbers \(c_{\rho,n}\) up to \(n=10\). On the other hand, the untwisted Dowker sum was found in [21] to be given by  
\[S_{v,1}(m) = \sum_{k=1}^{m-1}\csc{2v}\left(\frac{k\pi}{m}\right)=\frac{2}{(2v-1)! }\left(\frac{m}{\pi}\right)^{2v}\sum_{n=0}^{v-1}\left(\frac{2\pi}{m}\right)^{2n} \tag{15}\] \[\times s(v,n)\Gamma(2v-2n)\zeta(2v-2n)\left(1-\frac{1}{m^{2v-2n}}\right).\]  
Thus, it is seen that both sums are similar, with the differences occurring in the powers of the summands and the factors outside the sums. By applying the SymmetricPolynomial, Gamma, Zeta, Sum, and Table routines in Mathematica [17], we were able to derive the first 15 values of \(v\) for both sums with only a few lines of code. To accomplish this, (11) is implemented in Mathematica as  
\(\text{S2[m}_{-,V}\text{--}\text{--}\text{--}\text{--}\text{--}\text{--}\text{--} \text{--}\text{--}\text{--}\text{--}  
Consequently, for \(n=3\), we obtain the following output:  
In[5]:= FullSimplify[S1[3, m]]  
Out[5]= \(\frac{1}{945}\) (\(-1+\text{m}\)) (\(1+\text{m}\)) (\(191+23\text{ m}^{2}+2\text{ m}^{4}\)),  
which represents \(S_{3,1}(m)\). To obtain all the results for the untwisted Dowker sum up to \(v\), one must write the second instruction as  
\[\text{F1}[\text{n}_{-},\text{m}_{-}]:=\text{Table}[\text{Simplify}[\text{S1}[ \text{v},\text{m}]],\,\{v,1,n\}].\]  
Then, by setting \(n=3\) in \(\text{F1}[\text{m}_{-},\text{n}_{-}]\) and wrapping it around the Timing routine in Mathematica, one arrives at  
In[6]:= Timing[F1[3, m]]  
Out[6]= \(\left\{0.000377,1/3\,(-1+\text{m}^{2}),\,1/45\,(-11+10\text{ m}^{2}+\text{m}^{4}),\,1/945\,(-191+168\text{ m}^{2}+21\text{ m}^{4}+2\text{ m}^{6})\right\}\). This means it took \(0.000377\) s to generate the first three untwisted Dowker sums on the same Venom Blackbook Zero laptop mentioned previously. Note also that there are no powers of \(\pi\) as in the Gardner-Fisher sum. In fact, the factor outside the results in Table 3 is equal to \(\zeta(2v)/\pi^{2v}\). It should be mentioned here that the results obtained above and later on are exact due to the fact that they are computed using integer arithmetic, not machine-dependent decimal numbers. This means that there is no error involved in their determination. Furthermore, if \(m\) is set to a rational value, then the numerical value will be expressed as a rational subject to the memory of the computing system which, for the laptop used in this paper, is a few terabytes.