### Calculating the simple continued fraction of log_{b}a

This performs an algorithm from T.H. Jackson and K.R. Matthews, *On Shanks' algorithm for computing the continued fraction of log*_{b}a, Journal of Integer Sequences **5** (2002) article 02.2.7.

We run the algorithm for c = d^{r}, r = m,...,n.

Here a, b, d, m, n are positive integers satisfying a > b > 1, d > 1 and 1 ≤ m ≤ n.

With d=b, we have found that apart from a few initial exceptional values of r, the correct partial quotients will be returned.

Moreover, with d = b and a = b + 1, it seems that the correct partial quotients are always returned.

For example,

- (a,b,d,m,n)=(3730,371,371,1,30) is spectacularly incorrect on line 11, but otherwise seems to be well behaved.
- (a,b,d,m,n)=(2741,4,4,1,30) is incorrect on lines 10 and 15.
- (a,b,d,m,n)=(3,2,2,1,30) is well behaved.
- (991,2,2,1,n) seems to be correct if n > 146.

This is a BCMath version of the BC program log

*Last modified 21st March 2018*

Return to main page