The Problem is: Does the series $$\sum_{n=1}^\infty \frac {\left(\cos\left(\frac{n\pi}{8}\right)\right)^n}{n}$$ converge or diverge or oscillate ?
My approach : Actually, the series is not absolutely convergent because the subsequence $T_{16k} \gt \sum_{j=1}^k \frac{1}{16j}$ and hence becomes divergent where $T_n$ represents the partial sums of the absolute series .
Now, I have tried to apply the Dirichlet's test on the series but I think the series $$\sum_{n=1}^\infty \left(\cos\left(\frac{n\pi}{8}\right)\right)^n$$ is not bounded because if $n =8k,8k+1,...,8k+7$ for all non-negative integers $k$ , then except $n=8k$, the rest of the series forms into distinct brackets of infinite geometric progressions with common ratio(s) $r \lt 1$ but we get $1+1+..1+...$ in the series for $n=8k$ values and hence the series becomes unbounded .
I can't approach further, a small hint is warmly appreciated .
Let $a_n$ be the $n$th term of our series. I'll show $\sum a_n$ is the sum of a convergent series and a divergent series. This implies $\sum a_n$ diverges.
Define $b_n=0$ if $n$ is a multiple of $8,$ $b_n=a_n$ otherwise. Define $c_n = \frac{1}{n}$ if $n$ is a multiple of $8,$ $c_n=0$ otherwise. Then $a_n=b_n+c_n$ for all $n.$
Now $|b_n| \le (\cos(\pi/8))^n$ for all $n,$ and $\sum_{n=1}^{\infty}(\cos(\pi/8))^n$ is a convergent geometric series. Thus $\sum b_n$ converges.
As for $\sum c_n,$ let $S_n$ be its $n$th partial sum. Then
$$S_{8m} = \sum_{k=1}^{m} \frac{1}{8k}$$
and thus $S_{8m}\to \infty$ as $m\to \infty.$ Therefore $\sum c_n$ is divergent.
So $\sum a_n$ is the sum of a convergent series and a divergent series as advertised, and we're done.