OFFSET
3,2
COMMENTS
We conjecture that an integer is always reached.
The occurrence of the first 1, 2, 3, 4 etc. is at the indices 7, 4, 13, 20, 10, 5, 29, 76, 50, 452, 244, 830, 49, 91, 319, 2639, 5753, 2215, 6151, 7148, 280, 28, 1783 - R. J. Mathar, Nov 25 2006
REFERENCES
N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.
LINKS
R. J. Mathar, Table of n, a(n) for n = 3..7147
J. C. Lagarias and N. J. A. Sloane, Approximate squaring (pdf, ps), Experimental Math., 13 (2004), 113-128.
N. J. A. Sloane, Seven Staggering Sequences.
MAPLE
g := proc(x) local M, t1, t2, t3; M := 3^100; t1 := ceil(x) mod M; t2 := x*t1; t3 := numer(t2) mod M; t3/denom(t2); end;
f := proc(n) local t1, c; global g; if type(n, 'integer') then RETURN(0); fi; t1 := g(n); c := 1; while not type(t1, 'integer') do c := c+1; t1 := g(t1); od; RETURN(c); end;
[seq(f(n/3), n=3..120)]; # this gives the correct answer as long as the answer is < 99.
MATHEMATICA
a[n_] := Module[{x = n/3, s = 0}, While[!IntegerQ[x], x *= Ceiling[x]; s++]; s]; Table[a[n], {n, 3, 107}] (* Jean-François Alcover, Jan 27 2019, from PARI *)
PROG
(PARI) A072340(n)={ local(x, s) ; x=n/3 ; s=0 ; while( type(x)!="t_INT", x *= ceil(x) ; s++ ; ) ; return(s) ; } { for(n=3, 10000, print(n, " ", A072340(n)) ; ) ; } \\ R. J. Mathar, Nov 25 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane and J. C. Lagarias, Sep 03 2002
STATUS
approved