We have the known [BBP(Bailey–Borwein–Plouffe)-type formulas](https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula),


$$\ln3 = \sum\_{n=0}^\infty\frac{1}{2^{2n}}\left(\frac{1}{2n+1}\right)$$


$$\ln5 = \frac{1}{2^2}\sum\_{n=0}^\infty\frac{1}{2^{4n}}\left(\frac{2^2}{4n+1}+\frac{2^2}{4n+2}+\frac{1}{4n+3}\right)$$


However, I noticed that if we define the function,



> 
> $$R\big(a,b\big) = \sum\_{n=0}^\infty\frac{1}{(2^a)^n}\left(\sum\_{j=1}^{a-1}\frac{2^{a-1-j}}{an+j}+\sum\_{k=1}^{a/b-1}(-1)^{k+1}\frac{2^{a-1-bk}}{an+bk}\right)\tag1$$
> 
> 
> 


then it seems BBP-type formulas for *Fermat numbers* $2^{2^m}+1$ with $m>0$ have a common form,


$$\ln 5 = \frac1{2^{2}}R\big(2^2,2^1\big)$$


$$\ln 17 = \frac1{2^{13}}R\big(2^4,2^2\big)$$


$$\ln 257 = \frac1{2^{252}}R\big(2^8,2^3\big)$$


$$\color{brown}{\ln 65537 \overset{?}= \frac1{2^{65531}}R\big(2^{16},2^4\big)}$$



> 
> **Q: Is the formula for $p=65537$ true?**
> 
> 
> 


I've used Mathematica to verify the $p=5,\,17,\,257$ to hundreds of decimal digits, and also $p=65537$ using its initial terms, but how do we rigorously prove that $(1)$ is true for Fermat numbers $>3$?


**P.S.** In this [paper](http://davidhbailey.com/dhbpapers/bbp-formulas.pdf), the authors were not(?) able to find $p=65537$ and is missing in the list. 



Is this BBP-type formula for $\ln 257$ and $\ln 65537$ true?
Yes, this actually holds for all Fermat numbers! Let's start with the identity
$$\log 2=\sum\_{k=1}^{\infty}\frac{1}{k2^k}$$
and try to work out an expression for 
$$\log (2^{2^s}+1)=2^{s}\log 2+\log\left(1-\frac{1}{2^{2^{s+1}}}\right)-\log\left(1-\frac{1}{2^{2^s}}\right)$$
$$=2^s\left(\sum\_{k=1}^{\infty}\frac{1}{k2^k}\right)-\left(\sum\_{k=1}^{\infty}\frac{1}{k2^{k2^{s+1}}}\right)+\left(\sum\_{k=1}^{\infty}\frac{1}{k2^{k2^{s}}}\right)$$
$$=\sum\_{n=0}^{\infty}\frac{1}{2^{n2^{2^s}}}\left(\sum\_{j=1}^{2^{2^s}}\frac{2^{s-j}}{n2^{2^s}+j}-\sum\_{h=1}^{2^{2^s-s-1}}\frac{2^{-h2^{s+1}}}{n2^{2^{s}-s-1}+h}+\sum\_{l=1}^{2^{2^s-s}}\frac{2^{-l2^s}}{n2^{2^s-s}+l}\right)$$
$$=\sum\_{n=0}^{\infty}\frac{1}{2^{n2^{2^s}}}\left(\sum\_{j=1}^{2^{2^s}}\frac{2^{s-j}}{n2^{2^s}+j}-\sum\_{h=1}^{2^{2^s-s-1}}\frac{2^{-(2h)2^{s+1}}}{n2^{2^{s}-s}+2h}+\sum\_{l=1}^{2^{2^s-s}}\frac{2^{-l2^s}}{n2^{2^s-s}+l}\right)$$
$$=\sum\_{n=0}^{\infty}\frac{1}{2^{n2^{2^s}}}\left(\sum\_{j=1}^{2^{2^s}}\frac{2^{s-j}}{n2^{2^s}+j}+\sum\_{l=1}^{2^{2^s-s}}\frac{(-1)^{l+1}2^{-l2^s}}{n2^{2^s-s}+l}\right)$$
here we see that the terms at $j=2^{2^s}$ and $l=2^{2^s-s}$ cancel out, so after factoring out $\frac{1}{2^{2^{2^s}-s-1}}$ we are left with the defining expression of $R$ with $a=2^{2^s}, b=2^s$:
$$\log(2^{2^s}+1)=\frac{1}{2^{2^{2^s}-s-1}}R(2^{2^s},2^s).$$


