**The continued fraction of log(N) and the powers of N**

An interesting relation between powers of 2 and 3 was noted in
L.E. Garner "On the Collatz 3n+1 algorithm", Proc. Am. Math. Soc. 82, 1981,
19-22.

Given the j-th power of 3, let p(j) be the largest power of 2 that is
less than 3^{j}. Therefore
2^{p(j)} < 3^{j} < 2^{p(j)+1}
The author noticed that "the powers of 2 appear to be bounded away from the
powers of 3 by an amount which grows almost as rapidly as the power of 3", and
he defines

b(m) = maxThen the article presents a table of the values of m at which b(m) or B(m) increase. Here is the table with a few more columns:_{j ≤ m}[-log(1 - 2^{p(j)}/3^{j})] B(m) = max_{j ≤ m}[-log(2^{p(j)+1}/3^{j}- 1)]

- the index of the row, k
- the difference, dm, between m(k) and m(k-1)
- the value of p(m) or P(m)=p(m)+1, when b or B increases, respectively
- the difference, dp, between p or P at m and at m-1
- the number of rows with same dm
- whether b(m) or B(m) increases

k m dm p/P dp nr b(m) B(m) 1______1______1______2______1______1___*____+_____ 22132 1 + 3______3______1______5______2______2____ ___+_____ 45283 + 5______7______2_____11______3______2___+__________ 6125198 + 7_____17______5_____27______8______3________+_____ 8 29 12 46 19 + 941126519 + 10_____53_____12_____84_____19______1___+__________ 11_____94_____41____149_____65______5________+_____ 12 147 53 233 84 + 13 200 53 317 84 + 14 253 53 401 84 + 153065348584 + 16____359_____53____569_____84______2___+__________ 176653061054485 + 18____971____306___1539____485_____23________+_____ 19 1636 665 2593 1054 + 20 2301 665 3647 1054 + ... 4015601665247271054 + 41__16266____665__25781___1054______2___+__________ 42 31687 15601 50508 24727 + ...

The rows can be grouped into blocks. A block ends after a shift from
increasing b(m) to increasing B(m), or viceversa.

The number nr(m) are the numbers of rows in the block.

The quotients in bold p(m)/m, or P(m)/m, are "the best" approximations to log_{2}(3).

The coefficients of the continued fraction expansion of log_{2}(3)
is the sequence A028507 in the On-line Encyclopedia of
Integer Sequences.

1, 1, 1, 2, 2, 3, 1, 5, 2, 23, 2, 2, 1, 1, 55, 1, 4, 3, 1, 1, 15, 1, 9, 2, 5, 7, 1, 1, 4, 8, 1, 11, 1, 20, 2, 1, 10, 1, 4, 1, 1, 1, 1, 1, 37, 4, 55, 1, 1, 49, 1, 1, 1, 4, 1, 3, 2, 3, 3, 1, 5, 16, 2, 3, 1, 1, 1, 1, 1, 5, 2, 1, 2, 8, 7, 1, 1, 2, 1, 1, 3, 3, 1, 1, 1, 1, 5, 4, 2, 2, 2, 16, 8, 10, 1, 25, 2, ...

The convergents of this continued fraction are the "best approximations" fractions
in the above table.

**Prove that the numbers nr(j) are the terms of the sequence A028507.**

Hint.

This is a general fact. It holds for any pair of numbers, not just 2 and 3.

Consider the differences |p(m)/m - log_{2}(3)|.

Marco Corvi - 2016