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 A256598 #47 Feb 16 2025 08:33:25 %S A256598 1,3,5,1,5,1,7,11,17,13,5,1,9,7,11,17,13,5,1,11,17,13,5,1,13,5,1,15, %T A256598 23,35,53,5,1,17,13,5,1,19,29,11,17,13,5,1,21,1,23,35,53,5,1,25,19,29, %U A256598 11,17,13,5,1,27,41,31,47,71,107,161,121,91,137,103,155 %N A256598 Irregular triangle where row n contains the odd terms in the Collatz sequence beginning with 2n+1. %C A256598 The Collatz function is an integer-valued function given by n/2 if n is even and 3n+1 if n is odd. We build a Collatz sequence by beginning with a natural number and iterating the function indefinitely. It is conjectured that all such sequences terminate at 1. %C A256598 In this triangle, row n is made up of the odd terms of the Collatz sequence beginning with 2n+1. Therefore, it is conjectured that this sequence is well-defined, i.e., that all rows terminate at 1. %C A256598 The last index k in row n gives the number of iterations required for the Collatz sequence to terminate if even terms are omitted. %C A256598 T(n,k)/T(n,k+1) is of form: ceiling(T(n,k)*3/2^j) for some j>=1. Therefore, the coefficients in each row may be read as a series of iterated ceilings, where j may vary. For example, row 3 has initial term 7, which is followed by ceiling(7*3/2), ceiling(ceiling(7*3/2)*3/2), ceiling(ceiling(ceiling(7*3/2)*3/2)*3/4), ceiling(ceiling(ceiling(ceiling(7*3/2)*3/2)*3/4)*3/8), ceiling(ceiling(ceiling(ceiling(ceiling(7*3/2)*3/2)*3/4)*3/8)*3/16). %C A256598 The length of row n is A258145(n) (set to 0 if 1 is not reached after a finite number of steps). - _Wolfdieter Lang_, Aug 11 2021 %H A256598 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">Collatz Problem</a> %H A256598 Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a> %H A256598 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %F A256598 T(n,0) = 2n+1 and T(n,k) = A000265(3*T(n,k-1)+1) for k>0. - _Tom Edgar_, Apr 04 2015 %e A256598 Triangle starts T(0,0): %e A256598 n\k 0 1 2 3 4 5 6 7 8 9 10 ... %e A256598 0: 1 %e A256598 1: 3 5 1 %e A256598 2: 5 1 %e A256598 3: 7 11 17 13 5 1 %e A256598 4: 9 7 11 17 13 5 1 %e A256598 5: 11 17 13 5 1 %e A256598 6: 13 5 1 %e A256598 7: 15 23 35 53 5 1 %e A256598 8: 17 13 5 1 %e A256598 9: 19 29 11 17 13 5 1 %e A256598 10: 21 1 %e A256598 11: 23 35 53 5 1 %e A256598 12: 25 19 29 11 17 13 5 1 %e A256598 ... %e A256598 n=13 starts with 27 and takes 41 steps: (27), 41, 31, 47, 71, 107,... 53, 5, 1, (see A372443). %e A256598 Row 8 is [17, 13, 5, 1] because it is the subsequence of odd terms for the Collatz sequence starting with 17: [17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]. %t A256598 f[n_] := NestWhileList[(3*# + 1)/2^IntegerExponent[3*# + 1, 2] &, 2*n + 1, # > 1 &]; Grid[Table[f[n], {n, 0, 12}]] (* _L. Edson Jeffery_, Apr 25 2015 *) %o A256598 (Sage) %o A256598 def Collatz(n): %o A256598 A = [n] %o A256598 b = A[-1] %o A256598 while b != 1: %o A256598 if is_even(b): %o A256598 A.append(b//2) %o A256598 else: %o A256598 A.append(3*b+1) %o A256598 return A %o A256598 [y for sublist in [[x for x in Collatz(2*n+1) if is_odd(x)] for n in [0..15]] for y in sublist] # _Tom Edgar_, Apr 04 2015 %o A256598 (PARI) row(n) = {my(oddn = 2*n+1, vl = List(oddn), x); while (oddn != 1, x = 3*oddn+1; oddn = x >> valuation(x, 2); listput(vl, oddn)); Vec(vl);} %o A256598 tabf(nn) = {for (n=0, nn, my(rown = row(n)); for (k=1, #rown, print1(rown[k], ", ")); print;);} \\ _Michel Marcus_, Oct 04 2019 %Y A256598 Cf. A006370, A070165, A075677, A258145. %Y A256598 Cf. A372443 (row 13 up to its first 1). %Y A256598 Cf. also array A372283 showing the same terms in different orientation. %K A256598 nonn,tabf %O A256598 0,2 %A A256598 _Bob Selcoe_, Apr 03 2015