How can I assess and derive the time complexity of the BBP formula?$$BBP(n)=4S(1,n) - 2S(4,n) - S(5,n) - S(6,n)$$where$$S(j,n) = \sum_{k=0}^n{\frac{16^{n-k}mod(8k+j)}{8k+j}}+\sum_{k=n+1}^{\infty}{\frac{16^{n-k}}{8k+j}}$$Note that the modulo is evaluated using the binary modular exponentiation algorithm (which is supposedly O(log N)) and the second sum iterates only over a few elements, i.e. up to a certain $\epsilon$. I got O(N log N), but even if it is correct, I can't derive it.
What is the time complexity of the BaileyBorweinPlouffe formula?
time complexity