This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A060565 #22 Apr 25 2022 08:04:03 %S A060565 2,4,5,7,10,10,10,13,11,16,20,19,23,22,23,25,20,28,38,31,37,34,46,37, %T A060565 29,40,47,43,38,46,61,49,38,52,61,55,64,58,76,61,47,64,74,67,61,70,91, %U A060565 73,56,76,61,79,91,82,61,85,65,88,101,91,118,94,77,97,74,100,86,103 %N A060565 Follow trajectory of 2n+1 in the '3x+1' problem until a lower number is reached; A060445 gives number of steps for this to happen. Sequence gives the first lower number that is reached. %H A060565 Alois P. Heinz, <a href="/A060565/b060565.txt">Table of n, a(n) for n = 1..20000</a> %H A060565 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %p A060565 b:= proc(n, t) option remember; `if`(n<t, n, %p A060565 b(`if`(n::even, n/2, 3*n+1), t)) %p A060565 end: %p A060565 a:= n-> b((2*n+1)$2): %p A060565 seq(a(n), n=1..80); # _Alois P. Heinz_, Jan 22 2022 %t A060565 b[n_, t_] := b[n, t] = If[n<t, n, b[If[EvenQ[n], n/2, 3n+1], t]]; %t A060565 a[n_] := b[2n+1, 2n+1]; %t A060565 Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Apr 25 2022, after _Alois P. Heinz_ *) %o A060565 (PARI) a(n) = my(N=2*n+1, m=N); while(m >= N, m = if (m%2, 3*m+1, m/2)); m; \\ _Michel Marcus_, Jan 22 2022 %Y A060565 Cf. A060445. %K A060565 nonn,easy %O A060565 1,1 %A A060565 _N. J. A. Sloane_, Apr 12 2001 %E A060565 More terms from Larry Reeves (larryr(AT)acm.org), Apr 13 2001