I am looking for the proof of the following claim:


First, define the function $\operatorname{sgn\_1}(n)$ as follows:
$$\operatorname{sgn\_1}(n)=\begin{cases} -1 \quad \text{if } n \neq 3 \text{ and } n \equiv 3 \pmod{4}\\1 \quad \text{if } n \in \{2,3\} \text{ or } n \equiv 1 \pmod{4}\end{cases}$$


Let $n=p\_1^{\alpha\_1} \cdot p\_2^{\alpha\_2} \cdot \ldots \cdot p\_k^{\alpha\_k}$ , where the $p\_i$s are the $k$ prime factors of order $\alpha\_i$ .


Next, define the function $\operatorname{sgn\_2}(n)$ as follows: $$\operatorname{sgn\_2}(n)=\displaystyle\prod\_{i=1}^k(\operatorname{sgn\_1}(p\_i))^{\alpha\_i}$$


Then, $$\pi=\displaystyle\sum\_{n=1}^{\infty} \frac{\operatorname{sgn\_2}(n)}{n}$$


The first few terms of this series: $$\pi=1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\frac{1}{5}+\frac{1}{6}-\frac{1}{7}+\frac{1}{8}+\frac{1}{9}+\frac{1}{10}-\frac{1}{11}+\frac{1}{12}+\frac{1}{13}-\frac{1}{14}+ \ldots$$


The sum of the first $3000000$ terms gives the following result rounded to the $37$ decimal places: $$\displaystyle\sum\_{n=1}^{3000000} \frac{\operatorname{sgn\_2}(n)}{n}=3.1415836871743792245050824485818285768$$


The SageMath cell that demonstrates this infinite series can be found [here](https://sagecell.sagemath.org/?z=eJw9jcsKwjAQRff9imyEmRIfE92F-Qf3UsFqWwMxDWmysvrtxlCd1blw75nUstrl09U0OAKH_DQ9OLESB2YS8ywcsxIL7GXoYgoOCH-0JkT9-q5VWVvuL9c4hhy0Zx_GGxgmaTs3xDvYN8ryyJ6MpAbPBVSTHYvPFxtP6VF2qZVFbbAG2prcq3wwLsJU0-Yfjgb1B_5wPQY=&lang=gp&interacts=eJyLjgUAARUAuQ==).



The constant $\pi$ expressed by an infinite series
This can be proved similarly as [Alexander Kalmynin's method](https://mathoverflow.net/a/395350/156029) .


Let, the sum be $S$, then we can make the following identity because $\text{sgn}\_1$ of $2,3$ is defined to be $1$. So, $\text{sgn}\_1(ak)=\text{sgn}\_1(k), a=2,3,6$. Also, from the definition of $\text{sgn}\_2$ we can see, $\text{sgn}\_2(n)=1,-1$ respectively for $n \equiv 1,-1 (\text{modulo} 4)$.


As, $\text{sgn}\_1(ak)=\text{sgn}\_1(k), a=2,3$, we can separate them out from $S$ in the form of $\frac{S}{2}+\frac{S}{3}$. To prevent double counting of the $6$s multiples, we subtract $\frac{S}{6}$. Then, what is left is all odd numbers which aren't divisible by $3$. So, they can be classified as, $12k+\sigma , \sigma=1,-1,5,-5$ and also these are of the form $4k±1$.


The identity : $$S=\frac{S}{2}+\frac{S}{3}-\frac{S}{6}+\left(\sum\_{n\geq 0}\frac{1}{12n+1}-\sum\_{n\geq 1}\frac{1}{12n-1}\right)+\left(\sum\_{n\geq 0}\frac{1}{12n+5}-\sum\_{n\geq 1}\frac{1}{12n-5}\right)$$


This gives $\frac{S}{3}=(1+\frac{1}{5})+\frac{1}{12^2}\left(\sum\_{n=1}^{\infty} \frac{2}{(\frac{1}{12})^2-n^2}+\sum\_{n=1}^{\infty} \frac{
10}{(\frac{5}{12})^2-n^2}\right)$


or, $\frac{S}{3}=\frac{\pi}{12}\left(\text{cot}(\frac{\pi}{12})+\text{cot}(\frac{5\pi}{12})\right)$


This gives $S=\pi$


