Context: I recently discovered the formula for $\pi$ by Machin, $$\frac{\pi}{4} = 4\arctan \left(\frac15 \right) - \arctan{\left(\frac1{239} \right)}$$ In order to apply this formula, I used the Taylor series expansion for $\arctan x $ to create the following fixed-precision formula for $\frac{\pi}{4}$: $$ a(x) = \lim_{N\to\infty} \sum_{n=0}^N \frac{(-1)^n x^{2n+1}}{2n+1} \\ \implies \frac{\pi}{4} = 4a\left(\frac15 \right) - a \left(\frac{1}{239}\right)$$
I found that this was quite a useful computational formula: $N = 0$ already yields 1 correct decimal place, $N = 1$ yields 3 decimal places, $N = 2$ still yields 3 decimal places, and $N = 5$ yields 5 correct decimal places. Now I can't help but wonder: what's the pattern? Can I construct some explicit sequence $d(N)$ that returns the amount of correct decimal places for every $N$?
edit: removed superfluous example at the beginning