login
Number of steps to reach an integer starting with s = n/3 and iterating the map x -> s*ceiling(x).
8

%I #7 Jul 30 2013 10:46:51

%S 0,2,4,0,1,1,0,13,2,0,3,2,0,1,1,0,2,4,0,8,5,0,1,1,0,7,9,0,2,7,0,1,1,0,

%T 3,2,0,6,2,0,1,1,0,2,3,0,10,3,0,1,1,0,3,3,0,2,3,0,1,1,0,5,2,0,5,2,0,1,

%U 1,0,2,10,0,3,7,0,1,1,0,8,4,0,2,6,0,1,1,0,5,2,0,3,2,0,1,1,0,2,5,0,4,6,0,1,1,0

%N Number of steps to reach an integer starting with s = n/3 and iterating the map x -> s*ceiling(x).

%e s = 5/3 -> 10/3 -> 20/3 -> 35/3 -> 20, so a(5) = 4.

%p 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)];

%t ce[n_] := Length[NestWhileList[(n/3)*Ceiling[#] &, n/3, ! IntegerQ[#] &]] - 1; Table[ce[n], {n, 3, 108}] (* _Jayanta Basu_, Jul 30 2013 *)

%Y Cf. A072340, A074090, A074091, A074096. Records are in A074097, A074098.

%Y First integer reached: A081852.

%K nonn

%O 3,2

%A _N. J. A. Sloane_, Sep 16 2002