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-6 of 6 results.

A224299 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 term is not counted).

Original entry on oeis.org

0, 1, 4, 9, 4, 8, 14, 4, 17, 36, 13, 7, 24, 9, 36, 38, 24, 23, 55, 20, 28, 77, 20, 25, 93, 9, 100, 29, 37, 38, 78, 17, 36, 120, 7, 60, 99, 16, 54, 67, 9, 106, 184, 43, 74, 153, 51, 16, 84, 34, 10, 212, 12, 170, 208, 26, 60, 57, 8, 57, 92, 53, 85, 58, 148, 52
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 A210468 with n negative.

Examples

			For n = 3, a(3) = 9 because the corresponding trajectory of -1/7 requires 9 iterations 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,{n,-2,-100,-1}]]  (* program from T. D. Noe, adapted for this sequence - see A210468 *)

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

Original entry on oeis.org

0, 2, 3, 3, 3, 15, 3, 6, 7, 11, 8, 5, 12, 5, 6, 2, 7, 6, 3, 10, 8, 7, 7, 25, 7, 22, 26, 7, 7, 27, 23, 4, 4, 17, 4, 12, 18, 9, 4, 16, 13, 15, 19, 17, 18, 3, 19, 2, 3, 18, 20, 15, 3, 5, 3, 8, 19, 8, 8, 21, 8, 8, 22, 15, 8, 52, 8, 49, 23, 19, 16, 49, 8, 31, 32
Offset: 0

Views

Author

Michel Lagneau, Jan 23 2013

Keywords

Examples

			The 2nd row [3, 3, 15, 3] gives the number of iterations of k/5 and starts with A210468(2):
k=1 => 1/5 -> 8/5 -> 4/5 -> 2/5 with 3 iterations;
k=2 => 2/5 -> 1/5 -> 8/5 -> 4/5 with 3 iterations;
k=3 => 3/5 -> 14/5 -> 7/5 -> 26/5 -> 13/5 -> 44/5 -> 22/5 -> 11/5 -> 38/5 -> 19/5 -> 62/5 -> 31/5 -> 98/5 -> 49/5 -> 152/5 -> 76/5 with 15 iterations;
k=4 => 4/5 -> 2/5 -> 1/5 -> 8/5 with 3 iterations.
The array starts:
  [0];
  [2, 3];
  [3, 3, 15, 3];
  [6, 7, 11, 8, 5, 12];
  [5, 6, 2, 7, 6, 3, 10, 8];
  [7, 7, 25, 7, 22, 26, 7, 7, 27, 23];
  ...
		

Crossrefs

Cf. A210468.

Programs

  • Maple
    with(numtheory): z:={1}:
       for m from 0 to 20 do:
                 T:=array(1..2*m):k:=0:n:=2*m+1:
          for nn from 1 to 2*m do:
                 lst:={nn/n}:x0:=nn: ii:=0:
            for a from 1 to 20 while(ii=0) do:
                 if irem(x0,2)=0 then
                 x0:=x0/2:lst:=lst union{x0/n} :else ii:=1:fi:
            od:
                 x:=x0*3+n: lst:=lst union {x/n}:
                   for i from 1 to 6000 do:
                x:=x/2: lst:=lst union {x/n}:  if irem(x,2)=1 then
                x0:=x:x:=x0*3+n: lst:=lst union {x/n}:else fi:
               od:
              n0:=nops(lst):if lst intersect z = {1} then
              n1:=n0-2: k:=k+1: T[k]:=n1: else n1:=n0-1: k:=k+1:T[k]:=n1:fi:
       od:
         print (T):
    od:
  • 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] (* T. D. Noe, Jan 23 2013 *)

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

Original entry on oeis.org

0, 1, 2, 7, 3, 3, 2, 0, 3, 6, 5, 4, 15, 7, 5, 8, 9, 3, 11, 6, 7, 16, 1, 0, 8, 2, 7, 4, 3, 4, 16, 5, 7, 25, 4, 17, 19, 5, 13, 12, 6, 7, 17, 18, 8, 6, 7, 3, 0, 3, 22, 4, 3, 8, 31, 14, 10, 6, 9, 11, 26, 12, 19, 21, 32, 10, 9, 10, 1, 31, 8, 7, 18, 2, 8, 16, 11, 76
Offset: 1

Views

Author

Michel Lagneau, Jan 26 2013

Keywords

Comments

This sequence is the unification, in the limit, of the length of Collatz sequences for all fractions whose denominator is odd, and also all integers.
The sequence A210483 gives the triangle read by rows giving trajectory of k/(2n+1) in Collatz problem, k = 1..2n, but particular attention should be paid to numbers in 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 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).
Remark: a(A000124(n)) = A006577(n) because the first column of this triangle generates A006577.
The 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
  0;
  1,  2;
  7,  3,  3;
  2,  0,  3,  6;
  5,  4, 15,  7,  5;
  ...
Individual numbers have the following Collatz sequences:
[1] => [0] (0 iteration);
[2  1/3] => [1, 2] because: 2 -> 1  => 1 iteration;  1/3 -> 2 -> 1 => 2 iterations;
[3  2/3  1/5] => [7, 3, 3] because: 3->10->5->16->8->4->2->1 => 7 iterations; 2/3 -> 1/3 -> 2 -> 1 => 3 iterations; 1/5 -> 8/5 -> 4/5 -> 2/5 => 3 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, -3], 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, 12}, {k, 0, n - 1}]; Flatten[t] (* T. D. Noe, Jan 28 2013 *)

A210471 Collatz (3x+1) problem with rational numbers: number of steps to reach the end of the cycle starting with 1/(2n+1).

Original entry on oeis.org

1, 3, 4, 7, 6, 8, 5, 18, 9, 32, 11, 77, 25, 9, 6, 36, 29, 18, 17, 12, 28, 14, 23, 45, 73, 55, 91, 16, 17, 39, 7, 36, 40, 114, 87, 100, 93, 34, 54, 64, 14, 55, 171, 80, 57, 72, 42, 108, 24, 12, 97, 68, 31, 159, 88, 10, 41, 50, 23, 117, 63, 61, 8, 55, 72, 45, 68
Offset: 0

Views

Author

Michel Lagneau, Jan 22 2013

Keywords

Comments

In this sequence, the initial value is counted and a(n) = A210468(n) + 1.
This variation of the "3x+1" problem with a class of rational numbers is as follows: start with any number 1/(2n+1). 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.

Crossrefs

Cf. A210468.

Programs

  • Mathematica
    Collatz[n_]:=NestWhileList[If[EvenQ[Numerator[#]], #/2, 3 #+1]&, n, UnsameQ, All]; Join[{1}, Table[s=Collatz[1/(2*n+1)]; len=Length[s]-1; If[s[[-1]]==2, len=len-1]; len, {n,100}]]

Formula

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

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.

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-6 of 6 results.