# Algorithms for Various Trigonometric Power Sums
## 1 Introduction
More recently, however, these sums have appeared in a study of the entanglement entropy in string theory [PERSON] (1990), where the argument inside the trigonometric powers are the fractions \(k/m\) multiplied by \(2\pi\), rather than \(\pi\). The most fascinating trigonometric power sums are those possessing inverse powers of the sine or cosine, including tangent and cotangent, because their evaluation generally involves the zeta function directly, or through related numbers such as the Bernoulli and Euler numbers. In these types of trigonometric power sums, the solution is number-theoretical in nature [PERSON] and [PERSON] (1988); [PERSON] and [PERSON] (1999); [PERSON] and [PERSON] (1999), whereas if it is a basic trigonometric power sum, i.e., possessing only even positive powers of sine or cosine, then it is combinatorial [PERSON] and [PERSON] (1999); [PERSON] (1988). Nevertheless, this paper will present new developments concerning both positive and negative powers of the trigonometric function in the summand. Specifically, this paper is concerned with developing an algorithm for evaluating general twisted trigonometric power sums, which are defined as  
\[T^{\pm}_{v,l}(m,r)\doteq\sum_{k=1}^{lm-1}(\pm 1)^{k}\cos\Bigl{(}\frac{2 rk\pi}{ lm}\Bigr{)}\csc^{2v}\Bigl{(}\frac{k\pi}{lm}\Bigr{)}. \tag{9}\]  
In the above equation, \(r\) is an integer lying between \(1\) and \(m-1\), while \(l\) can equal to \(1\) or \(2\). The major difference between these sums and the other sums mentioned above is the appearance of an extra cosine factor next to the trigonometric power. That is, most of the previous studies have been concerned with the untwisted or \(r=0\) forms of (9), with the exception being the papers of [PERSON] and [PERSON] [12; 13]. As indicated earlier, [PERSON] was the first to find physical applications of trigonometric power sums possessing an extra cosine factor next to the trigonometric power [6; 8]. The sums were later referred to as twisted Dowker sums by [PERSON] and [PERSON] [12; 13], when developing [PERSON]'s results further. Nevertheless, these twisted trigonometric power sums were concerned mainly with the non-alternating \(l\!=\!1\) case of (9). In keeping with these papers, we shall refer to the sums with \(l\!=\!1\) as the Dowker case. In addition, we shall generalize the works of these authors so that one can observe the underlying number-theoretical and combinatorial behavior emanating from the sums. Moreover, we shall study the corresponding \(l\!=\!2\) forms, which will be referred to as the Gardner-Fisher case following from the seminal role of these two authors in this case. Our ultimate goal, however, will be to develop general algorithms capable of yielding: (1) purely rational values for the four types of trigonometric power sums defined by (9) when \(m\) and \(r\) are specified values, and (2) polynomials in powers of \(m\) and \(r\) when both variables are algebraic. To complete this introduction, it should be stated that trigonometric power sums are not only affected by the power and type of trigonometric function in the summand, but also by the different sequences of rationals multiplying \(\pi\) in the arguments of these functions. As a result, it becomes a formidable task to devise a master theorem that can cover all kinds of trigonometric power sums. Nevertheless, we shall obtain deep and meaningful results for both the Dowker and Gardner-Fisher cases. In addition, whilst polynomial expressions in powers of \(m\) and \(r\) can be obtained, the same cannot be said for the power, \(v\), in (9). That is, the value of the trigonometric power must always be specified before the solution to a particular sum can be determined.