login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087666 Consider recurrence b(0) = n/3, b(k+1) = b(k)*floor(b(k)); a(n) is the least k such that b(k) is an integer, or -1 if no integer is ever reached. 10

%I #27 Mar 01 2021 19:06:22

%S 0,3,4,0,1,1,0,3,2,0,3,7,0,1,1,0,2,3,0,2,2,0,1,1,0,5,5,0,5,6,0,1,1,0,

%T 9,2,0,8,3,0,1,1,0,2,5,0,2,2,0,1,1,0,3,3,0,6,3,0,1,1,0,4,2,0,6,4,0,1,

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

%N Consider recurrence b(0) = n/3, b(k+1) = b(k)*floor(b(k)); a(n) is the least k such that b(k) is an integer, or -1 if no integer is ever reached.

%C It is conjectured that an integer is always reached if the initial value n/3 is >= 2.

%H Benoit Cloitre, Graph of (sum(k=6,n,a(k))-2n)*n^(-1/2), <a href="https://dl.dropbox.com/u/46675017/Graph%20%28A%28n%29-2n%29%3Asqrt%28n%29.png">pdf</a>

%H J. C. Lagarias and N. J. A. Sloane, Approximate squaring (<a href="http://neilsloane.com/doc/apsq.pdf">pdf</a>, <a href="http://neilsloane.com/doc/apsq.ps">ps</a>), Experimental Math., 13 (2004), 113-128.

%F a(n)=0 iff n == 0 (mod 3), a(n)==1 iff n == 1 or 2 (mod 3^2), a(n)=2 iff n == 14,22,25,26 (mod 3^3). In general a(n)=m iff n == x (mod 3^m) where x pertains to a set of 2^m distinct elements included in {1,2,...,(3^m)-1}. Conjecture: a(6) + a(7) + a(8) + ... + a(n) = 2n + O(sqrt(n)). - _Benoit Cloitre_, Sep 24 2012

%p # Gives right answer as long as answer is < M.

%p # This is better than the Mathematica or PARI programs.

%p M := 50; f := proc(n) local c,k,tn,tf; global M; k := n/3; c := 0; while whattype(k) <> 'integer' do tn := floor(k); tf := k-tn; tn := tn mod 3^50; k := tn*(tn+tf); c := c+1; od: c; end; # _N. J. A. Sloane_

%t f[n_] := If[ Mod[3n, 3] == 0, 0, Length[ NestWhileList[ #1*Floor[ #1] &, n, !IntegerQ[ #2] &, 2]] - 1]; Table[f[n/3], {n, 6, 120}] (* _Robert G. Wilson v_ *)

%o (PARI) a(n)=if(n<0,0,c=n/3; x=0; while(frac(c)>0,c=c*floor(c); x++); x) \\ _Benoit Cloitre_, Sep 29 2003

%o (Python)

%o def A087666(n):

%o c, x = 0, n

%o a, b = divmod(x,3)

%o while b != 0:

%o x *= a

%o c += 1

%o a, b = divmod(x,3)

%o return c # _Chai Wah Wu_, Mar 01 2021

%Y Cf. A083863 (integer reached), A086336 and A087663 (records), A057016, A087710, A088706 (inverse).

%K nonn

%O 6,2

%A _N. J. A. Sloane_, Sep 27 2003

%E More terms from _Benoit Cloitre_, Sep 29 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)