A073341 Number of steps to reach an integer starting with (2n+1)/4 and iterating the map x -> x*ceiling(x).
3, 2, 3, 8, 1, 1, 3, 2, 2, 3, 2, 2, 1, 1, 7, 4, 4, 2, 4, 3, 1, 1, 2, 4, 2, 8, 4, 3, 1, 1, 6, 4, 3, 2, 5, 4, 1, 1, 5, 2, 2, 3, 2, 2, 1, 1, 4, 5, 6, 2, 3, 5, 1, 1, 2, 3, 2, 4, 3, 6, 1, 1, 7, 8, 3, 2, 4, 5, 1, 1, 3, 2, 2, 3, 2, 2, 1, 1, 7, 3, 4, 2, 7, 6, 1, 1, 2, 5, 2, 5, 5, 3, 1, 1, 3, 3, 3, 2, 10, 3, 1, 1, 4, 2, 2
Offset: 2
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 2..10000
- J. C. Lagarias and N. J. A. Sloane, Approximate squaring (pdf, ps), Experimental Math., 13 (2004), 113-128.
Programs
-
Maple
g := proc(x) local M,t1,t2,t3; M := 4^100; t1 := ceil(x) mod M; t2 := x*t1; t3 := numer(t2) mod M; t3/denom(t2); end; a := []; for n from 2 to 150 do t1 := (2*n+1)/4; for i from 1 to 100 do t1 := g(t1); if type(t1,`integer`) then break; fi; od: a := [op(a),i]; od: a;
-
Mathematica
a[n_] := Length @ NestWhileList[# Ceiling[#]&, (2n+1)/4, !IntegerQ[#]&] - 1; Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jan 31 2023 *)
-
PARI
a(n)=if(n<1,0,s=n/2+1/4; c=0; while(frac(s)>0,s=s*ceil(s); c++); c) \\ Benoit Cloitre, Sep 05 2002
Comments