Closed - form expression for the finite sum $\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi\, k}{n}+\frac{\pi }{2 \ n}\right)$
Is there a closed - form expression for the finite sum on the secant function : $$\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi \, k}{n}+\frac{\pi }{2\,n}\right)$$ as a function of n?
Motivation:
The sum is part of a more elaborated solution of Eric Naslund of the integral:
$$\int_0^{\infty } \text{sech}(z)\,\text{sech}(n\,z) \, dz = \frac{\pi}{2\, n} \sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi\, k}{n}+\frac{\pi }{2\,n}\right)+\frac{1}{2} \pi \sec \left(\frac{\pi\, n}{2}\right)$$
which holds for any even number n.
Attempt at a solution:
There are some interesting papers, WEN CHANG CHU, Djurdje Cvijovic, H.M. Srivastava and HONGWEI CHEN, considering the summation of finite secant sums.
Investigations of the first bibliographical reference lead to the closed form expression for the similar finite sum:
$$\sum _{k=0}^n (-1)^k \sec \left(2 \left(\frac{\pi\,k}{n}+y\right)\right)=\frac{2\,n \,\sin \left(\frac{\pi\,n}{4}\right) \,\cos \left(\frac{n\,y}{2}\right)}{\cos (n\,y)-\cos \left(\frac{\pi\,n}{2}\right)}+\sec (y)$$
with $y = \frac{1}{2\,n}$, which can be further investigated by:
$$\sec (2\,z) = \frac{\sec ^2(z)}{2-\sec ^2(z)}$$
and
$$\sec (\frac{z}{2})=\frac{\sqrt{2}}{\sqrt{\cos (z)+1}} (-1)^{\left\lfloor \frac{\pi +\Re(z)}{2 \pi }\right\rfloor } \left(1-\left((-1)^{\left\lfloor -\frac{\pi +\Re(z)}{2 \pi }\right\rfloor +\left\lfloor \frac{\pi +\Re(z)}{2 \pi }\right\rfloor }+1\right) \theta (-\Im(z))\right) $$ where $\Theta$ is the "unitstep" - function.
In case of the last bibliographical reference, the main difference to the sum above is, that [HONGWEI CHEN], deals only with higher powers of a similar sum - but without that "factor 2" - e.g.
$$S_{2 n}(\text{q})\text{:=}\sum _{p = 0\,\text{;}\,p\neq \frac{q}{2} (\text{q is even})}^{q-1} \sec ^{2\, n}\left(\frac{\pi\, p}{q}\right)$$
Another attempt at a solution is to write the sum as a "q-series" Dieckmann.
EDIT
A new approach is to split the sum e.g. for $n=4,8,12,...$ [Claude Leibovici]
$$\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi (2\,k+1)}{2\,n}\right)=2 \sum _{l=0}^{\frac{n}{4}-1} (-1)^l \sec \left(\frac{\pi \, (2\,l+1)}{2\,n}\right)-2 \sum _{l=0}^{\frac{n}{4}-1} (-1)^l \csc \left(\frac{\pi\, (2\,l+1)}{2\,n}\right)$$
The summary of the preliminary work give some evidence that a closed - form expression exists:
The finite sum can be simplified to:
$$S_{n}=\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi\,k}{n}+\frac{\pi }{2\,n}\right)=2 \,\sum _{k=0}^{\frac{n}{2}-1} \sec \left(\frac{2\,\pi\,k}{n}+\frac{\pi}{2\,n}\right)$$
For the proof one has to split the sum in even and odd "k's".
From expressions of the first bibliographical reference and the help of Dieckmann the following identity can be proven:
$$W_{n}=\sum _{k=0}^n \frac{1}{\cos \left(\frac{2\, \pi\, k}{n}\right)+z}=\frac{ n \,\cot \left(\frac{n}{4}\, \left(2\, \sin^{-1}(z)+\pi \right)\right)}{\sqrt{1-z^2}}+\frac{1}{z+1}$$
From the proof of the main result of [HONGWEI CHEN] one derive the further identity:
$$V_{n}=\sum _{k=0}^n \frac{1}{\cos \left(\frac{\pi \, k}{n}\right)+z}=\frac{z}{z^2-1}-\frac{n \cot \left(n \cos ^{-1}(z)\right)}{\sqrt{1-z^2}}$$
Now we split the finite sum $W_{n}$ for even numbers n:
$$W_{n}=\sum _{k=0}^{\frac{n}{2}} \frac{1}{\cos \left(\frac{2 \,\pi \, k}{n}\right)+z}+\sum _{k=\frac{n}{2}+1}^n \frac{1}{\cos \left(\frac{2\,\pi \,k}{n}\right)+z}$$
We express the first sum of $W_{n}$ by $V_{n}$ and solve for the last sum. This leads to:
$$S_{z,w,n}=2 \sum _{k=0}^{n-1} \frac{1}{z-\cos \left(\frac{\pi \, k}{n}+\frac{\pi}{w\,n}\right)}$$
For $w=1$ we have:
$$S_{z,1,n}=\frac{2\, n \,\left(\cot \left(n \cos ^{-1}(z)\right)+2\, \cot \left(\frac{1}{2} \,n \,\left(2 \,\sin ^{-1}(z)+\pi \right)\right)\right)}{\sqrt{1-z^2}}+\frac{2}{1-z^2}$$
The limit $\lim_{z\to 0}$ and $w=4$ gives the solution. With other words we need a general expression, dependent of $w$, with $S_{z,1,n}$ for $w=1$.
EDIT II
Mathematica can find a solution expressed in closed form using the q-polygamma function:
$$S_{\frac{n}{2}}=\frac{2\,n}{\pi } \left(\psi _{e^{-\frac{i\,\pi}{n}}}\left(\frac{1}{4}-\frac{n}{2}\right)-2\, \psi _{e^{-\frac{i\,\pi }{n}}}\left(\frac{1}{4}+\frac{n}{2}\right)+\psi_{e^{-\frac{i\,\pi }{n}}}\left(\frac{1}{4}+\frac{3\,n}{2}\right)\right)$$
where $\psi _q(z)$ is the q-polygamma function. With the function "FunctionExpand" Mathematica expands the q-polygamma function with the complex argument and one can verify the radicals of [Vepir]. Numerically the values can be optained by the well-known identity for the q-polygamma function:
$$\psi _q(x+1)=\psi _q(x)-\frac{q^x \log (q)}{1-q^x}$$
Using the identity n-times recursively, in the expression $S_{\frac{n}{2}}$, $\psi _q(x)$ for $x=\frac{1}{4}$ vanishes!
Summary
These results are the same!
- $$\mathcal{I}\left( n \right)=\int_0^{\infty } \text{sech}(z)\,\text{sech}(n\,z) \, dz$$
- $$\mathcal{I}\left( n \right)=\frac{1}{n}\sum _{k=0}^{\infty } (-1)^k \left(\psi \left(\frac{3 n+2k+1}{4 n}\right)-\psi \left(\frac{n+2 k+1}{4 n}\right)\right)$$
- $$\mathcal{I}\left( n \right)=\frac{\pi}{2\,n} \sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi\, k}{n}+\frac{\pi }{2\,n}\right)+\frac{1}{2} \pi \sec \left(\frac{\pi\, n}{2}\right)$$
- $$\mathcal{I}\left( n \right)=\frac{\pi} {2 \,n} \left(\sum _{l=0}^{\infty } \frac{\left(E_l\right){}^2 \left(\frac{i\, \pi }{2\, n}\right)^l}{l!}-n \,i^n\right)+\frac{1}{2} \pi \sec \left(\frac{\pi\, n}{2}\right)$$
- $$\mathcal{I}\left( n \right)=\frac{1}{2} \left(\psi _{e^{-\frac{2\, i \,\pi}{n}}}\left(\frac{1-n}{4}\right)-2\, \psi _{e^{-\frac{2\, i\, \pi }{n}}}\left(\frac{1+n}{4}\right)+\psi_ {e^{-\frac{2\, i\, \pi }{n}}}\left(\frac{1}{4} (1+3 \,n)\right)\right)+ \\ +\frac{1}{2} \pi \sec \left(\frac{\pi\, n}{2}\right)$$
- $$\mathcal{I}\left( n \right)=\frac{\pi}{2\,n} \left((n+1)-\sec\left(\frac{\pi }{2 \,n}\right)\left(\sin \left(\frac{\pi }{2\, n}\right)-3\right)+\\ + 2\, \sum _{m=-\frac{n}{4}}^{\frac{n}{4}} \cot \left(\frac{\pi \, \left(m-\frac{1}{4}\right)}{n}\right)+2 \sum_{m=-\frac{n}{2}}^{\frac{n}{2}} \frac{1}{\cot\left(\frac{\pi \, \left(m-\frac{1}{4}\right)}{n}\right)-1}\right) +\frac{1}{2} \pi \sec \left(\frac{\pi\, n}{2}\right)$$
"6." follows from "5" and has a nice form for $n=2,6,10,\cdots$. The first term is the approximation of [Claude Leibovici].
Solution 1:
Define the sequence of numbers for all positive even integer $n$ $$ a_n := \sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{\pi \, k}{n}+\frac{\pi }{2\,n}\right). \tag{1} $$ The sequence has an asymptotic power series expansion in powers of $\,1/n\,$ $$ a_n \sim -n\,i^n + \sum_{k=0}^\infty \frac{E_k^2}{k!} \left(\frac{\pi\, i}{2\, n}\right)^k. \tag{2} $$ All terms with odd $\,k\,$ in the summation are zero since the Euler number $\,E_k=0.\,$ The series is asymptotic so the partial sums start to converge but after a certain point they diverge to infinity. However, the Wikipedia article on divergent series lists several methods of summing divergent series and one or more of them may be of use here.
Note that Euler numbers are OEIS sequence A122045 with e.g.f. $\text{sech}(x),\,$ but the sequence of its squares $\,E_k^2\,$ is not in OEIS and so it is unlikely for its e.g.f. to have a simple closed form, but it still may be possible. The Wikipedia article 1-1+2-6+24-120+... gives hope that this may be the case.
The Wolfram language code I used for exploring $q$-digamma based on the expression of the OP.
ClearAll[ank, a, ax, qd, f];
ank[n_,k_] := (-1)^k Sec[Pi k/n + Pi/2/n];
a[n_?EvenQ] := a[n] = Sum[ ank[n, k], {k, 0, n-1}];
ax[n_, t_] := -n I^n + Sum[ EulerE[k]^2 (I Pi/2/n)^k/k!, {k, 0, 2*t}];
qd[z_, q_] := QPolyGamma[z, q]; (* q-digamma = psi_q(z) *)
f[n_, q_:0] := Module[{q1 = If[q==0, Exp[2 Pi I/n], q]},
n/Pi (qd[(1-n)/4, q1] - 2 qd[(1+n)/4, q1] + qd[(1+3n)/4, q1])];
Notice that evaluating the $q$-digamma in f[n]
at roots of unity
blows up and Mathematica will leave it unevaluated. You can verify
this by evaluating f[n,Exp[2 Pi I/n]x]
where $x$ is close to $1$.
Also, notice that f[n]//FunctionExpand//N
does not evaluate to
a numerical value for even integer values of $\,n\ge12.\,$
Solution 2:
For an approximation, it seems that for $n=2,6,10,\cdots$ $$S_n=\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{(2 k+1)\pi }{2 n}\right)\sim 1+n$$ and that for $n=4,8,12,\cdots$ $$S_n=\sum _{k=0}^{n-1} (-1)^k \sec \left(\frac{(2 k+1)\pi }{2 n}\right)\sim 1-n$$
For illustration
$$\left( \begin{array}{ccc} n & 1+n & S_n\\ 2 & 3 & 2.82843 \\ 6 & 7 & 6.96953 \\ 10 & 11 & 10.9882 \\ 14 & 15 & 14.9939 \\ 18 & 19 & 18.9963 \\ 22 & 23 & 22.9975 \end{array} \right)$$
$$\left( \begin{array}{ccc} n & 1-n & S_n\\ 4 & -3 & -3.06147 \\ 8 & -7 & -7.01795 \\ 12 & -11 & -11.0083 \\ 16 & -15 & -15.0047 \\ 20 & -19 & -19.0030 \\ 24 & -23 & -23.0021 \end{array} \right)$$