%I #39 Nov 01 2021 01:08:08
%S 1,4,2,1,2,1,3,10,5,16,8,4,2,1,4,2,1,5,16,8,4,2,1,6,3,10,5,16,8,4,2,1,
%T 7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,8,4,2,1,9,28,14,7,22,11,
%U 34,17,52,26,13,40,20,10,5,16,8,4,2,1,10,5,16,8,4,2,1,11,34,17,52,26,13
%N Triangle read by rows T(n,k) in which row n gives the trajectory of n in Collatz problem including the trajectory [1, 4, 2, 1] for n = 1.
%C Also [1, 4, 2] together with A070165.
%H Michael De Vlieger, <a href="/A235795/b235795.txt">Table of n, a(n) for n = 1..11449</a> (rows 1..250, flattened)
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%H <a href="/index/Be#Benford">Index entries for sequences related to Benford's law</a>
%e The irregular triangle begins:
%e 1,4,2,1;
%e 2,1;
%e 3,10,5,16,8,4,2,1;
%e 4,2,1;
%e 5,16,8,4,2,1;
%e 6,3,10,5,16,8,4,2,1;
%e 7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1;
%e 8,4,2,1;
%e 9,28,14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1;
%e 10,5,16,8,4,2,1;
%e 11,34,17,52,26,13,40,20,10,5,16,8,4,2,1;
%e 12,6,3,10,5,16,8,4,2,1;
%e 13,40,20,10,5,16,8,4,2,1;
%e 14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1;
%e ...
%t Prepend[Array[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, #, # > 1 &] &, 10, 2], NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, 1, # > 1 &, {2, 1}]] // Flatten (* _Michael De Vlieger_, Oct 27 2021 *)
%o (PARI) f(n) = if (n%2, 3*n+1, n/2); \\ A014682
%o row(n) = {my(list=List()); listput(list, n); until(n==1, n = f(n); listput(list, n)); Vec(list);} \\ _Michel Marcus_, Sep 10 2021
%Y Cf. A000079, A014682, A006370, A070165, A235800, A235801, A347270 (all 3x+1 sequences).
%K nonn,tabf
%O 1,2
%A _Omar E. Pol_, Jan 15 2014
|