I was working on some continued fractions, and came across the fundamental recurrence formula above. It worked pretty well for some simple continued fractions (like √2) but seemed to be a bit unfriendly towards calculating π.

I'm using this definition of π:

Now, using that definition with the above equation, it was always completely wrong...

So I tried changing the equation...

I'm using this definition of π:

Now, using that definition with the above equation, it was always completely wrong...

So I tried changing the equation...

So you'll notice a few specific changes... 1) A

_{1}has been redefined in terms of previous results. 2) A

_{1}reduced the index on a

_{1}to a

_{0}. 3) A

_{n+1}changed the index on a

_{n+1}to a

_{n}. 4) B

_{n+1}changed the index on b

_{n+1}to b

_{n}.

This may seem like a lot of changes, but really #1 didn't change the outcome at all and the rest were all about reducing the index of a/b.

Net result? All the previous stuff (√2, golden mean, etc) give the same results as before... but now π works.