OFFSET
3,2
EXAMPLE
s = 5/3 -> 10/3 -> 20/3 -> 35/3 -> 20, so a(5) = 4.
MAPLE
f := proc(b1, b2) local c1, c2, t1, t2, t3, t4, i; c1 := numer(b1/b2); c2 := denom(b1/b2); i := 0; while c2 <> 1 do i := i+1; t1 := ceil(c1/c2); t2 := b1*t1; t3 := t2/b2; c1 := numer(t3); c2 := denom(t3); od: RETURN(i); end; [seq(f(n, 3), n=4..120)];
MATHEMATICA
ce[n_] := Length[NestWhileList[(n/3)*Ceiling[#] &, n/3, ! IntegerQ[#] &]] - 1; Table[ce[n], {n, 3, 108}] (* Jayanta Basu, Jul 30 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 16 2002
STATUS
approved