%I #22 Mar 20 2019 06:32:44
%S 0,2,1,4,-1,3,6,-1,2,-1,-1,5,-1,-1,-1,4,-1,4,-1,-1,7,-1,-1,-1,-1,-1,3,
%T 6,-1,-1,-1,-1,-1,-1,-1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,5,8,-1,-1,
%U -1,-1,5,-1,-1,-1,-1,-1,-1,-1,-1,8,-1,-1,-1,-1,-1,-1,-1
%N a(n) = number of iterations of x -> A306938(x) required to reach 1 when started at n, or -1 if the trajectory of n never reaches 1.
%C If the trajectory of n contains two consecutive non-multiples of 3 then it increases for ever [te Riele].
%H Amiram Eldar, <a href="/A306944/b306944.txt">Table of n, a(n) for n = 1..10000</a>
%H H. J. J. te Riele, <a href="https://ir.cwi.nl/pub/6662">Iteration of number-theoretic functions</a>, Nieuw Archief v. Wiskunde, (4) 1 (1983), 345-360. See Example III.3.
%t f[n_] := If[Divisible[n, 3], n/3, Floor[n*Sqrt[3]]]; a[n_] := Module[{k = n, inc = False, c = 0}, While[k > 1, kk = f[k]; If[inc && kk > k, c = -1; Break[]]; inc = kk > k; k = kk; c++]; c]; Array[a, 100]; (* _Amiram Eldar_, Mar 17 2019 *)
%Y Cf. A306938, A306943.
%K sign
%O 1,2
%A _N. J. A. Sloane_, Mar 17 2019
%E More terms from _Amiram Eldar_, Mar 17 2019
|