It is known that ($N$ positive integer)
$$ \frac{1}{2N} \sum_{n=0}^{N-1} \frac{1}{\left[\cos\left( \frac{(2n+1)\pi}{4N} \right)\right]^2} = N $$
see for example this MSE post A curious identity on sums of secants.
Is there a closed form for the analogous sum where first powers are involved?
$$ S_1(N):= \frac{1}{2N} \sum_{n=0}^{N-1} \frac{1}{\cos\left( \frac{(2n+1)\pi}{4N} \right)} $$
I suspect the answer won't be entirely trivial as $S_1(N)$ diverges logarithmically as $N\to \infty$.
I would be also interested in the analogous sum where the angles are even multiples of $\pi/(4 N)$, i.e., what about
$$ Z_1(N):= \frac{1}{2N} \sum_{n=0}^{N-1} \frac{1}{\cos\left( \frac{n\pi}{2N} \right)} $$
?