OFFSET
1,3
COMMENTS
It is known that a(n) is bounded by 2 log_2 (n) + 2; see my preprint linked below. - Jeffrey Shallit, Jun 14 2016
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..16384
Jon Borwein, Neil Calkin, Scott Lindstrom, and Andrew Mattingly, Continued logarithms and associated continued fractions, preprint, 2016.
J. Shallit, Length of the continued logarithm algorithm on rational inputs, arXiv:1606.03881 [math.NT], June 13 2016.
EXAMPLE
The expansions for n=2 to 19 are [1], [1,1], [2], [2,2], [2,1], [2,0,1,1], [3], [3,3], [3,2], [3,1,1,1], [3,1], [3,0,0,0,1], [3,0,1,1], [3,0,2,0,1,1], [4], [4,4], [4,3], [4,2,1,1]. - R. J. Mathar, Jun 02 2016
Displayed as a table with row lengths A000079 as suggested by a(A000079(k)) =1: - R. J. Mathar, Jun 04 2016
1,
1,2,
1,2,2,4,
1,2,2,4,2,5,4,6,
1,2,2,4,2,5,4,6,2,7,5,5,4,5,6,8,
1,2,2,4,2,5,4,6,2,7,5,5,4,5,6,8,2,9,7,6,5,6,5,6,4,8,5,7,6,6,8,10,
1,2,2,4,2,5,4,6,2,7,5,5,4,5,6,8,2,9,7,6,5,6,5,6,4,8,5,7,6,6,8,10,2,11,9,7,7,8,6,9,5,7,6,8,5,7,6,9,4,9,8,11,5,6,7,7,6,7,6,8,8,9,10,12
MAPLE
A273126 := proc(n)
local a , x, cf;
if n = 1 then
return 1;
end if;
cf := [] ;
x := n ;
while x > 1 do
a := ilog2(x) ;
cf := [op(cf), a] ;
x := x/2^a ;
if x = 1 then
break;
end if;
x := 1/(x-1) ;
end do:
nops(cf) ;
end proc:
seq(A273126(n), n=1..80) ; # R. J. Mathar, Jun 02 2016
PROG
(PARI) a(n) = my (x=n); for (w=1, oo, while (x>=2, x /= 2); if (x==1, return (w)); x = 1/(x-1); if (x<=1, return (w))) \\ Rémy Sigrist, Sep 09 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, May 16 2016
STATUS
approved