# Some alternating series converging to values relating to $\pi$.

The following series converge to a value relating to $\pi$: \begin{align} \frac{1}{1}-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\cdots&=\frac{\pi}{4},\\ \frac{1}{1^2}+\frac{1}{3^2}+\frac{1}{5^2}+\frac{1}{7^2}+\cdots&=\frac{\pi^2}{8},\\ \frac{1}{1^3}-\frac{1}{3^3}+\frac{1}{5^3}-\frac{1}{7^3}+\cdots&=\frac{\pi^3}{32},\\ \frac{1}{1^4}+\frac{1}{3^4}+\frac{1}{5^4}+\frac{1}{7^4}+\cdots&=\frac{\pi^4}{96},\\ \frac{1}{1^5}-\frac{1}{3^5}+\frac{1}{5^5}-\frac{1}{7^5}+\cdots&=\frac{5\pi^5}{1536}. \end{align}

It seems that if we define $$f(n):=\sum_{i=0}^{\infty}\Big(\frac{(-1)^i}{2i+1}\Big)^n,\quad n\in\mathbb{N}_+,$$ then the values of $f$ are related to $\pi$, and in fact I guess we have $$f(n)=A\pi^n,\quad A\in\mathbb{Q}.$$

This is strongly reminiscent of Basel problem, where we have a famous solution based on the Weierstrass factorization theorem. Trying to imitate that proof, I want to find a real function $g$ with $$Z:=g^{-1}(0)=\Big\{\frac{(-1)^i}{2i+1}:i\in\mathbb{N}\Big\},$$ and $g$ can be factorized as something like $$g(x)=\prod_{a\in Z}\Big(1-\frac{x}{a}\Big),$$ and by comparing the Taylor series of $g$ and applying Vieta's formulas and Newton's identities, we might find the value of $f(1)$ or even more. But these are just wild guesses. I haven't even studied complex analysis, and I'm only imitating the proof for Basel problem. I wonder if this leads to any reasonable solution.

My question is: How do we obtain the value of $f(n)$ and how do we prove these? Don't hesitate to post solutions based on complex analysis or more advanced analysis! Thanks in advance.

For even $n$, $$\sum_{k=0}^\infty\frac1{(2k+1)^n}=\left(1-\frac1{2^n}\right)\zeta(n).$$ The value of $\zeta(n)$ for even $n$ is well-known. It can be obtained from the functional equation connecting $\zeta(s)$ and $\zeta(1-s)$.
For odd $n$, $$\sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^n}=L(n,\chi)$$ where $\chi$ is a Dirichlet character of conductor $4$, and $L$ is a Dirichlet L-function There is a functional equation connecting $L(s,\chi)$ and $L(1-s,\chi)$. One can compute $L(n,\chi)$ for odd positive $n$ by using this.