%I #26 Dec 10 2016 19:40:37
%S 0,1,1,2,6,1,12,3,5,7,9,2,11,13,13,4,15,6,17,8,9,10,10,3,12,12,12,14,
%T 17,14,14,5,17,16,16,7,8,17,18,9,9,10,11,11,20,11,11,4,8,13,17,13,13,
%U 13,6,15,15,17,49,15,15,15,8,6,8,18,17,17,17,17,44,8
%N Number of steps needed to reach 1 or to enter the cycle in the "sqrt(3)*x+1" problem.
%C The sqrt(3)*x+1 problem is as follows: start with a number x. If x is even, divide it by 2, otherwise multiply it by sqrt(3) and add 1, and then take the integer part.
%C There are three possible behaviors for such trajectories when n>0:
%C (i) The trajectory reaches 1 (and enters the "trivial" cycle 2-1-2-1-2...).
%C (ii) Cyclic trajectory. The trajectory becomes periodic and the period does not contain a 1.
%C (iii) The trajectory is divergent trajectory (I conjecture that this cannot occur).
%C For many numbers, the element of the trivial cycle is 1, except for the numbers: 3, 6, 12, 19, 21, 24, 29, 33, 37, 38, 42, 43, 48, 49, 51, 55, 57, 58, ... where the elements of the nontrivial cycle are respectively 6, 3, 3, 38, 74, 3, 58, 19, 74, 76, 74, 37, 3, 98, 29, 6, 37, 33, ...
%H Michel Lagneau, <a href="/A264789/b264789.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3) = 1 because 3 -> 6 -> 3 -> 6 ...
%e a(7) = 12 because 7 -> 13 -> 23 -> 40 -> 20 -> 10 -> 5 -> 9 -> 16 -> 8 -> 4 -> 2 -> 1 where:
%e 13 = floor(7*sqrt(3)+1);
%e 23 = floor(13*sqrt(3)+1);
%e 40 = floor(23*sqrt(3)+1);
%e 20 = 40/2;
%e 10 = 20/2;
%e 5 = 10/2;
%e 9 = floor(5*sqrt(3)+1);
%e 16 = floor(9*sqrt(3)+1);
%e 8 = 16/2; 4 = 8/2; 2 = 4/2 and 1 = 2/2 is the end of the cycle.
%p A264789 := proc(n)
%p local cyc,x;
%p x := n;
%p cyc := {x} ;
%p for s from 0 do
%p if 1 in cyc then
%p return s;
%p end if;
%p if type(x,'even') then
%p x := x/2 ;
%p else
%p x := floor(sqrt(3)*x+1) ;
%p end if;
%p if x in cyc and s > 0 then
%p return s;
%p end if;
%p cyc := cyc union {x} ;
%p end do:
%p end proc: # _R. J. Mathar_, Nov 27 2015
%t Table[Length@ NestWhileList[If[EvenQ@ #, #/2, Floor[# Sqrt@ 3 + 1]] &, n, UnsameQ, All] - 2, {n, 0, 72}] (* _Michael De Vlieger_, Nov 25 2015 *)
%Y Cf. A006577.
%K nonn
%O 1,4
%A _Michel Lagneau_, Nov 25 2015
|