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

A224399 Numbers k such that A224166(k) = A008908(k).

Original entry on oeis.org

1, 2, 4, 8, 13, 16, 26, 32, 35, 52, 64, 70, 81, 93, 104, 128, 140, 162, 181, 186, 208, 241, 256, 280, 324, 362, 372, 416, 455, 482, 483, 512, 543, 560, 607, 643, 645, 648, 724, 744, 809, 815, 832, 903, 910, 914, 915, 964, 966, 967, 1024, 1079, 1081, 1086, 1087
Offset: 1

Views

Author

Michel Lagneau, Apr 05 2013

Keywords

Comments

Numbers k for which the number of iterations starting with -k to reach the last number of the cycle equals the number of iterations starting with k to reach 1 in Collatz (3x+1) trajectory of +/-k.

Examples

			a(6) = 26 because A224166(26) = A008908(26) = 11.
The trajectory of - 26 is :
-26 -> - 13 -> -38 -> -19 -> -56 -> -28 -> -14 -> -7 -> -20 -> -10 -> -5 with 11 iterations (the first value is counted);
The trajectory of 26 is :
26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with 11 iterations (the first value is counted).
		

Crossrefs

Programs

  • Maple
    z:={1}:
      for m from -1 by -1 to -1500 do:
       lst:={m}:a:=0: x:=m: lst:=lst union {x}:
            for i from 1 to 100 do:
             lst:=lst union {x}:
             if irem(abs(x), 2)=1
             then
             x:=3*x+1: lst:=lst union {x}:
             else
             x:=x/2: lst:=lst union {x}:
             fi:
             od:
             n0:=nops(lst):
             if lst intersect z = {1}
             then
             n1:=n0-2:
             else
             n1:=n0-1:
          fi:
           a:=0:y:=-m:
              for it from 1 to 100 while (y>1) do:
                 if irem(y,2)=0
                 then
                 y := y/2:a:=a+1:
                 else
                  y := 3*y+1: a := a+1:
                 fi:
              od:
              if n1=a
              then
              printf(`%d, `,-m):
              else
              fi:
    od:

A224254 Full cycle lengths in the Collatz (3x+1) problem when the negative integers are used.

Original entry on oeis.org

2, 2, 2, 2, 5, 2, 5, 2, 5, 5, 2, 2, 5, 5, 2, 2, 18, 5, 5, 5, 18, 2, 18, 2, 18, 5, 5, 5, 2, 2, 18, 2, 18, 18, 5, 5, 18, 5, 2, 5, 18, 18, 2, 2, 18, 18, 5, 2, 18, 18, 5, 5, 2, 5, 18, 5, 2, 2, 2, 2, 18, 18, 5, 2, 2, 18, 18, 18, 2, 5, 2, 5, 18, 18, 5, 5, 2, 2, 2, 5, 5
Offset: 1

Views

Author

Michel Lagneau, Apr 02 2013

Keywords

Comments

There are other cycles of lengths 2, 5 and 18 if negative integers are used. In Z, it is conjectured that the five values of cycle are 1, 2, 3, 5 and 18 (see A121510).

Examples

			a(1) = 2 because the cycle -1 -> -2 -> -1... contains 2 distinct terms;
a(5) = 5 because the cycle -5 -> -14 -> -7->-20 -> -5 ... contains 5 distinct terms;
a(17) = 18 because the cycle -17 -> -50 -> -25->-74 -> -37 -> -110 -> -55->-164 -> -82 -> -41 -> -122->-61 -> -182 -> -91 -> -272->-136 -> -68 -> -34 -> -17... contains 18 distinct terms.
		

Crossrefs

Programs

  • Python
    import sympy
    def A224254(n):
      return next(sympy.cycle_length(lambda x:3*x+1 if x%2 else x//2,-n))[0] # Pontus von Brömssen, Jan 24 2021

Extensions

Data corrected by Pontus von Brömssen, Jan 24 2021

A346369 a(n) is the number of steps the Collatz trajectory of -n takes to reach a cycle, or -1 if no cycle is ever reached.

Original entry on oeis.org

0, 0, 3, 1, 0, 4, 0, 2, 7, 0, 5, 5, 5, 0, 8, 3, 0, 8, 3, 0, 6, 6, 1, 6, 0, 6, 3, 1, 9, 9, 4, 4, 11, 0, 9, 9, 0, 4, 12, 1, 0, 7, 7, 7, 5, 2, 12, 7, 9, 0, 7, 7, 15, 4, 0, 2, 28, 10, 10, 10, 0, 5, 15, 5, 36, 12, 3, 0, 18, 10, 18, 10, 7, 0, 5, 5, 13, 13, 13, 2, 18
Offset: 1

Views

Author

Felix Fröhlich, Jul 14 2021

Keywords

Comments

The analog of A139399 for negative starting values.
Is a(n) > -1 for all n?

Examples

			For n = 5: The trajectory of -5 starts -5, -14, -7, -20, -10, -5, -14, -7, -20, -10, -5, ..., with -5 already being part of the cycle {-5, -14, -7, -20, -10}, so a(5) = 0.
For n = 6: The trajectory of -6 starts -6, -3, -8, -4, -2, -1, -2, -1, -2, -1, -2, ..., reaching a term of the cycle {-2, -1} after 4 steps, so a(6) = 4.
		

Crossrefs

Programs

  • PARI
    a006370(n) = if(n%2==0, n/2, 3*n+1)
    trajectory(n, terms) = my(v=[n]); while(#v < terms, v=concat(v, a006370(v[#v]))); v
    a(n) = my(t, v=[]); for(k=1, oo, t=trajectory(-n, k); for(x=1, #t, if(x < #t && t[x]==t[#t], return(x-1))))

Formula

a(n) = A224166(n) - A224254(n) = 1 + A224183(n) - A224254(n). - Pontus von Brömssen, Jul 24 2021
Showing 1-3 of 3 results.