# Algorithms for Various Trigonometric Power Sums
## 4 Basic Trigonometric Power Sums  
Basic trigonometric power sums are defined as finite trigonometric power sums of the form  
\[\left\{ \begin{matrix}S(m,n)\\ C(m,n)\end{matrix} \right\}\doteqdot\sum_{k=0}^{g(n)}(\pm 1)^{k}f(k)\left\{ \begin{matrix}\cos^{2m}\\ \sin^{2m}\end{matrix} \right\}\left(\frac{qk\pi}{n}\right), \tag{34}\]  
where \(m\), \(q\) and \(n\) are positive integers, \(g(n)\) is dependent upon \(n\) such as \(n-1\) or even \(\lfloor m/n\rfloor\), and \(f(k)\) is a relatively simple function of \(k\), such as unity or \(\cos(k\pi/p)\) with \(p\), an integer. Besides the derivation of new results for interesting versions of these sums in [20], important applications were studied, such as the determination of the number of closed random walks of length \(2m\) with \(n-1\) vertices. The key results of this work are \begin{table}
\begin{tabular}{c c} \hline \(v\) & \(S_{v,2}^{-}(m)\) \\ \hline
1 & \(-\frac{1}{6}(2m^{2}+1+(-1)^{m}3)\) \\
2 & \(-\frac{1}{90}(14m^{4}+20m^{2}+11+(-1)^{m}45)\) \\
3 & \(-\frac{1}{1890}(124m^{6}+294m^{4}+336m^{2}+191+(-1)^{m}945)\) \\
4 & \(-\frac{1}{2530}(762m^{8}+2480m^{6}+4116m^{4}+4320m^{2}+2497+(-1)^{m}14175)\) \\
5 & \(-\frac{1}{817110}(2044m^{10}+8382m^{8}+17732m^{6}+25256m^{4}+25344m^{2}++1479 7+(-1)^{m}555)\) \\
6 & \(-\frac{1}{1270257505}(5657908m^{12}+27900600m^{10}+70936866m^{8}+123237400m^{6 }+161104944m^{4}\) \\  & \(+157248000m^{2}+94645408768+(-1)^{m}638512875\) \\
7 & \(-\frac{1}{5429670}(982920m^{14}+5657908m^{12}+16740360m^{10}+33888426m^{8}+524867 20m^{6}\) \\  & \(+6494342m^{4}+62208000m^{2}+36740617+(-1)^{m}273648375)\) \\
8 & \(-\frac{1}{97624698750}(711109434m^{16}+4678699200m^{14}+15774247504m^{12}+363186 09600m^{10}\) \\  & \(+64134554484m^{8}+92099363200m^{6}+109676294784m^{4}+103638528000m^{2}\) \\  & \(+61430943169+(-1)^{m}488462349375)\) \\
9 & \(-\frac{1}{890762984012510}(114993831140m^{18}+8511979992498m^{16}+3220231691880m^{ 14}\) \\  & \(+8300524457928m^{12}+16391733632820m^{10}+26409031340328m^{8}+35943148628160m^{6}\) \\  & \(+41612354477568m^{4}+38919315456000m^{2}+23133945892303+(-1)^{m}194894677400625)\) \\
10 & \(-\frac{1}{64319387452406250}(7689887297988m^{20}+63246607127000m^{18}+26529004099 95210m^{16}\) \\  & \(+756609992754000m^{14}+1650318606144780m^{12}+29351287511910000m^{10}\) \\  & \(+4426525536029520m^{8}+5787831372048000m^{6}+6557243257635840m^{4}\) \\  & \(+6083703521280000m^{2}+16399688681447+(-1)^{m}145510944665625)\) \\ \hline \end{tabular}
\end{table} 
Table 5: Values of \(S_{v,2}^{-}(m)\) for \(v\) up to and including 10. \[C(m,n)= \begin{cases}2^{1-2m}\,n\Big{(}\binom{2m-1}{m-1}+\sum_{p=1}^{\lfloor m/n \rfloor}\binom{2m}{m-pn}\Big{)},&\text{if }m\geqslant n,\\ 2^{1-2m}\,n\binom{2m-1}{m-1}\,&\text{if }m<n,\end{cases}  \tag{35}\]  
and  
\[S(m,n)= \begin{cases}2^{1-2m}\,n\Big{(}\binom{2m-1}{m-1}+\sum_{p=1}^{\lfloor m/ n\rfloor}(-1)^{pn}\binom{2m}{m-pn}\Big{)},&\text{if }m\geqslant n,\\ 2^{1-2m}\,n\binom{2m-1}{m-1},&\text{if }m<n,\end{cases}  \tag{36}\]  
where  
\[C(m,n):=\sum_{k=0}^{n-1}\cos^{2m}\left(\frac{k\pi}{n}\right), \tag{37}\]  
and  
\[S(m,n):=\sum_{k=0}^{n-1}\sin^{2m}\left(\frac{k\pi}{n}\right). \tag{38}\]  
Although the second result in each case is not necessary, since it is covered by the first result, they were displayed separately (1) because of their simplicity and (2) to make contact with the results on p. 640 of [24].