OFFSET
1,4
COMMENTS
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.
There are three possible behaviors for such trajectories when n>0:
(i) The trajectory reaches 1 (and enters the "trivial" cycle 2-1-2-1-2...).
(ii) Cyclic trajectory. The trajectory becomes periodic and the period does not contain a 1.
(iii) The trajectory is divergent trajectory (I conjecture that this cannot occur).
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, ...
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 1 because 3 -> 6 -> 3 -> 6 ...
a(7) = 12 because 7 -> 13 -> 23 -> 40 -> 20 -> 10 -> 5 -> 9 -> 16 -> 8 -> 4 -> 2 -> 1 where:
13 = floor(7*sqrt(3)+1);
23 = floor(13*sqrt(3)+1);
40 = floor(23*sqrt(3)+1);
20 = 40/2;
10 = 20/2;
5 = 10/2;
9 = floor(5*sqrt(3)+1);
16 = floor(9*sqrt(3)+1);
8 = 16/2; 4 = 8/2; 2 = 4/2 and 1 = 2/2 is the end of the cycle.
MAPLE
A264789 := proc(n)
local cyc, x;
x := n;
cyc := {x} ;
for s from 0 do
if 1 in cyc then
return s;
end if;
if type(x, 'even') then
x := x/2 ;
else
x := floor(sqrt(3)*x+1) ;
end if;
if x in cyc and s > 0 then
return s;
end if;
cyc := cyc union {x} ;
end do:
end proc: # R. J. Mathar, Nov 27 2015
MATHEMATICA
Table[Length@ NestWhileList[If[EvenQ@ #, #/2, Floor[# Sqrt@ 3 + 1]] &, n, UnsameQ, All] - 2, {n, 0, 72}] (* Michael De Vlieger, Nov 25 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 25 2015
STATUS
approved