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

This performs an algorithm based on a paper of 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.

Our algorithm is described in the altered version of that paper.
We run the algorithm for c = b^{r}, r = m,...,n (suggested by Alan Offer).

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

We employ the criterion A_{i,c} > c + b√c in the main loop and usually correct partial quotients are returned. However the example (a,b,m,n)=(991,2,146,148) shows that there are exceptions.

If we use the stronger cutoff condition A_{i,c} > c + b^{2}√c in the main loop, as in http://www.numbertheory.org/php/log3.html, this anomaly disappears. However fewer partial quotients will be returned.

*Last modified 6th January 2019*

Return to main page