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.

Showing 1-4 of 4 results.

A224300 Collatz problem with rational negative numbers: number of steps to reach the end of the cycle starting with 1/(2n+1) where n is negative (the initial value is counted).

Original entry on oeis.org

1, 2, 5, 10, 5, 9, 15, 5, 18, 37, 14, 8, 25, 10, 37, 39, 25, 24, 56, 21, 29, 78, 21, 26, 94, 10, 101, 30, 38, 39, 79, 18, 37, 121, 8, 61, 100, 17, 55, 68, 11, 107, 185, 44, 75, 154, 52, 17, 85, 35, 11, 213, 13, 171, 209, 27, 61, 58, 9, 58, 93, 54, 86, 59, 149
Offset: 1

Views

Author

Michel Lagneau, Apr 03 2013

Keywords

Comments

This variation of the "3x+1" problem with a class of rational negative numbers is as follows: start with any number 1/(2n+1), n= -1, -2, -3, .... If the numerator is even, divide it by 2, otherwise multiply it by 3 and add 1. Do we always reach the end of a cycle with a rational number? It is conjectured that the answer is yes. This sequence is an extension of A210471 with n negative.

Examples

			For n = 3, a(3) = 10 because the corresponding trajectory of -1/7 requires 10 iterations (the first term -1/7 is counted) to reach the last term of the cycle: -1/7 -> 4/7 -> 2/7 -> 1/7 -> 10/7 -> 5/7 -> 22/7 -> 11/7 -> 40/7 -> 20/7 and 20/7 is the last term because 20/7 -> 10/7 is already in the trajectory.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_]:=NestWhileList[If[EvenQ[Numerator[-#]],#/2,3 #+1]&,n,UnsameQ,All];Join[{0},Table[s=Collatz[1/(2 n+1)];len=Length[s]-2;If[s[[-1]]==2,len=len-1];len+1,{n,-2,-100,-1}]] (* program from T. D. Noe, adapted for this sequence - see A210471 *)

Formula

a(n) = A224299(n) + 1.

A224360 Triangle read by rows: T(n,k) = -1 + length of the Collatz sequence of -(n-k)/(2k+1) for n >= 1 and k >= 0.

Original entry on oeis.org

0, 1, 1, 4, 2, 4, 2, 0, 5, 9, 4, 3, 7, 10, 4, 5, 3, 6, 11, 5, 8, 4, 1, 0, 11, 1, 9, 14, 3, 6, 8, 13, 6, 8, 15, 4, 11, 4, 9, 12, 3, 10, 5, 5, 17, 4, 4, 7, 0, 2, 11, 16, 4, 18, 36, 6, 4, 14, 12, 4, 9, 16, 6, 9, 37, 13, 6, 5, 1, 16, 7, 13, 6, 1, 19, 16, 14, 7, 9
Offset: 1

Views

Author

Michel Lagneau, Apr 04 2013

Keywords

Comments

This sequence is an extension of A210516 with negative values.
We consider the triangle T(n,k) = -(n-k)/(2k+1) for n = 1,2,... and k = 0..n-1.
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).
The initial triangle T(n,k) begins
-1,
-2, -1/3;
-3, -2/3, -1/5;
-4, -3/3, -2/5, -1/7;
-5, -4/3, -3/5, -2/7, -1/9;
-6, -5/3, -4/5, -3/7, -2/9, -1/11;
...

Examples

			The triangle of lengths begins
  1;
  2, 2;
  5, 3, 5;
  3, 1, 6, 10;
  5, 4, 8, 11, 5;
  ...
Individual numbers have the following Collatz sequences (the first term is not counted):
[-1] => [1] because: -1 -> -1 with 0 iterations;
[-2 -1/3] => [1, 1] because: -2 -> -1 => 1 iteration; -1/3 -> 0 => 1 iteration;
[-3 -2/3 -1/5] => [4, 2, 4] because: -3 -> -8 -> -4 -> -2 -> -1 => 4 iterations; -2/3 -> -1/3 -> 0 => 2 iterations; -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 => 4 iterations.
		

Crossrefs

Programs

  • Mathematica
    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] - 1, {n, 13}, {k, 0, n - 1}]; Flatten[t] (* program from T. D. Noe, adapted for this sequence - see A210516 *)

Extensions

Better definition from Michel Marcus, Sep 14 2017

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

Original entry on oeis.org

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, 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, 5, 10, 17, 7, 10, 38, 14, 7, 6, 2, 17, 8, 14, 7, 2, 20, 17, 15
Offset: 1

Views

Author

Michel Lagneau, Apr 04 2013

Keywords

Comments

This sequence is the extension of A210688 with negative values.
We consider the triangle T(n,k) = -(n-k)/(2k+1) for n = 1,2,... and k = 0..n-1.
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).
The initial triangle T(n,k) begins
-1;
-2, -1/3;
-3, -2/3, -1/5;
-4, -3/3, -2/5, -1/7;
-5, -4/3, -3/5, -2/7, -1/9;
-6, -5/3, -4/5, -3/7, -2/9, -1/11;
...
Needs a more precise definition. - N. J. A. Sloane, Sep 14 2017

Examples

			The triangle of lengths begins
  1;
  2, 2;
  5, 3, 5;
  3, 1, 6, 10;
  5, 4, 8, 11, 5;
  ...
Individual numbers have the following Collatz sequences (including the first term):
  [-1] => [1] because -1 -> -1 with 1 iteration;
  [-2 -1/3] => [2, 2] because: -2 -> -1 => 2 iterations; -1/3 -> 0 => 2 iterations;
  [-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.
		

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = A224360(n) + 1.

A224367 Triangle read by rows giving trajectory of -k/(2n+1) in Collatz problem, k = 1..2n.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 6, 9, 10, 11, 11, 13, 12, 4, 5, 1, 6, 3, 2, 4, 7, 8, 9, 8, 10, 11, 9, 13, 11, 13, 12, 14, 15, 5, 16, 16, 6, 18, 17, 20, 17, 19, 7, 4, 5, 4, 6, 1, 5, 6, 7, 7, 2, 9, 6, 8, 7, 17, 18, 9, 19, 9, 10, 20, 20, 11, 10, 22, 11, 24, 21, 23, 21, 36, 37
Offset: 0

Views

Author

Michel Lagneau, Apr 05 2013

Keywords

Comments

Extension of A210483 with negative values, and subset of A224360.

Examples

			The 2nd row [4, 5, 7, 6] gives the number of iterations of -k/5 (the first element is not counted):
   k=1 => -1/5 ->2/5 -> 1/5 -> 8/5 -> 4/5 with 4 iterations;
   k=2 => -2/5 -> -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 with 5 iterations;
   k=3 => -3/5 -> -4/5 -> -2/5 -> -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 with 7 iterations;
   k=4 => -4/5 -> -2/5 -> -1/5 -> 2/5 -> 1/5 -> 8/5 -> 4/5 with 6 iterations.
The array starts:
  [0];
  [1, 2];
  [4, 5, 7, 6];
  [9, 10, 11, 11, 13, 12];
  [4, 5, 1, 6, 3, 2, 4, 7];
  ...
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[Numerator[-#]], #/2, 3 # + 1] &, n, UnsameQ, All]; t = Join[{{0}}, Table[s = Collatz[-k/(2*n + 1)]; len = Length[s] - 2; If[s[[-1]] == 2, len = len - 1]; len, {n, 10}, {k, 2*n}]]; Flatten[t] (* program from T. D. Noe, adapted for this sequence - see A210483 *)
Showing 1-4 of 4 results.