cp's OEIS Frontend

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.

A224361 The length of the Collatz (3k+1) sequence for all odd negative fractions and integers.

This page as a plain text file.
%I A224361 #21 Aug 07 2025 08:35:21
%S A224361 1,2,2,5,3,5,3,1,6,10,5,4,8,11,5,6,4,7,12,6,9,5,2,1,12,2,10,15,4,7,9,
%T A224361 14,7,9,16,5,12,5,10,13,4,11,6,6,18,5,5,8,1,3,12,17,5,19,37,7,5,15,13,
%U A224361 5,10,17,7,10,38,14,7,6,2,17,8,14,7,2,20,17,15
%N A224361 The length of the Collatz (3k+1) sequence for all odd negative fractions and integers.
%C A224361 This sequence is the extension of A210688 with negative values.
%C A224361 We consider the triangle T(n,k) = -(n-k)/(2k+1) for n = 1,2,... and k = 0..n-1.
%C A224361 The example shown below gives a general idea of this regular triangle. This contains all negative fractions whose denominator is odd and all integers. Now, from T(n,k) we could introduce a 3D triangle in order to produce a complete Collatz sequence starting from each rational T(n,k).
%C A224361 The initial triangle T(n,k) begins
%C A224361   -1;
%C A224361   -2, -1/3;
%C A224361   -3, -2/3, -1/5;
%C A224361   -4, -3/3, -2/5, -1/7;
%C A224361   -5, -4/3, -3/5, -2/7, -1/9;
%C A224361   -6, -5/3, -4/5, -3/7, -2/9, -1/11;
%C A224361   ...
%C A224361 Needs a more precise definition. - _N. J. A. Sloane_, Sep 14 2017
%F A224361 a(n) = A224360(n) + 1.
%e A224361 The triangle of lengths begins
%e A224361   1;
%e A224361   2, 2;
%e A224361   5, 3, 5;
%e A224361   3, 1, 6, 10;
%e A224361   5, 4, 8, 11, 5;
%e A224361   ...
%e A224361 Individual numbers have the following Collatz sequences (including the first term):
%e A224361   [-1] => [1] because -1 -> -1 with 1 iteration;
%e A224361   [-2 -1/3] => [2, 2] because: -2 -> -1 => 2 iterations; -1/3 -> 0 => 2 iterations;
%e A224361   [-3 -2/3 -1/5] => [5, 3, 5] because: -3 -> -8 -> -4 -> -2 -> -1 => 5 iterations; -2/3 -> -1/3 -> 0 => 3 iterations; -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 => 5 iterations.
%t A224361 Collatz2[n_] := Module[{lst = NestWhileList[If[EvenQ[Numerator[#]], #/2, 3 # + 1] &, n, Unequal, All]}, If[lst[[-1]] == -1, lst = Drop[lst, -2], If[lst[[-1]] == 2, lst = Drop[lst, -2], If[lst[[-1]] == 4, lst = Drop[lst, -1], If[MemberQ[Rest[lst], lst[[-1]]], lst = Drop[lst, -1]]]]]]; t = Table[s = Collatz2[-(n - k)/(2*k + 1)]; Length[s], {n, 13}, {k, 0, n - 1}]; Flatten[t] (* program from _T. D. Noe_, adapted for this sequence - see A210688 *)
%Y A224361 Cf. A210516, A210688, A224299, A224300, A224360.
%K A224361 nonn,tabl
%O A224361 1,2
%A A224361 _Michel Lagneau_, Apr 04 2013