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.

A222118 Number of terms in Collatz (3x+1) trajectory of n that did not appear in previous trajectories.

Original entry on oeis.org

1, 1, 6, 0, 0, 1, 10, 0, 3, 0, 0, 1, 0, 0, 9, 0, 0, 1, 5, 0, 3, 0, 0, 1, 3, 0, 95, 0, 0, 1, 0, 0, 3, 0, 0, 1, 3, 0, 12, 0, 0, 1, 8, 0, 3, 0, 0, 1, 0, 0, 5, 0, 0, 1, 7, 0, 3, 0, 0, 1, 0, 0, 13, 0, 0, 1, 0, 0, 3, 0, 0, 1, 3, 0, 8, 0, 0, 1, 9, 0, 1, 0, 0, 1, 0, 0, 7
Offset: 1

Views

Author

Jayanta Basu, Feb 23 2013

Keywords

Comments

For n > 2, n such that a(n) = 0 are termed impure (A134191), while n such that a(n) > 0 are termed pure (A061641). - T. D. Noe, Feb 23 2013
From Robert G. Wilson v, Feb 25 2017: (Start)
For a(n) to be equal to 0, n != 0 (mod 3),
For a(n) to be an even positive number, n = {3, 7} (mod 12),
For a(n) to be equal to 1, n = {0, 1, 2, 3, 6, 7, 9} (mod 12),
For a(n) to be equal to 3, n = {1, 3, 9} (mod 12),
For a(n) to be an odd number > 3, n = {3, 7} (mod 12).
[Note that the above conditions are necessary but not sufficient. - Editors, Dec 15 2017]
(End)
a(n) gives the number of new terms in the n-th row of A070165 (see A263716). - Andrey Zabolotskiy, Feb 27 2017

Examples

			a(7) = 10, since trajectory of 7 includes 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, which did not appear in earlier trajectories.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; found = {}; Table[c = Collatz[n]; r = Complement[c, found]; found = Union[found, c]; Length[r], {n, 100}] (* T. D. Noe, Feb 23 2013 *)
  • Python
    s = set([1])
    print(1)
    for n in range(2, 100):
        m, r = n, 0
        while m not in s:
            s.add(m)
            m = (m//2 if m%2==0 else 3*m+1)
            r += 1
        print(r)
    # Andrey Zabolotskiy, Feb 21 2017

Formula

a(n) = A006577(n) - A221956(n) + 1. - Michel Lagneau, Feb 23 2013

A347265 Positive integers in the order of their first appearance in the 3x+1 sequences.

Original entry on oeis.org

1, 4, 2, 3, 10, 5, 16, 8, 6, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 9, 28, 14, 12, 15, 46, 23, 70, 35, 106, 53, 160, 80, 18, 19, 58, 29, 88, 44, 21, 64, 32, 24, 25, 76, 38, 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182
Offset: 0

Views

Author

Omar E. Pol, Aug 27 2021

Keywords

Comments

The positive integers in the order of their first appearance in the rows of the square array A347270.
The first 8 terms of A263716 appear here in a different order.

Crossrefs

Cf. A000027, A006370, A347270. Another version of A263716.

Formula

a(n) = A263716(n), n >= 8.

A347271 Irregular triangle T(n,k) read by rows in which row n lists the terms of the 3x+1 trajectory of n, but the row ends when a term is a power of 2 or when a term is less than n, with n >= 1 and k >= 0.

Original entry on oeis.org

1, 2, 3, 10, 5, 16, 4, 5, 16, 6, 3, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 8, 9, 28, 14, 7, 10, 5, 11, 34, 17, 52, 26, 13, 40, 20, 10, 12, 6, 13, 40, 20, 10, 14, 7, 15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 16, 17, 52, 26, 13, 18, 9, 19, 58, 29, 88, 44, 22, 11
Offset: 1

Views

Author

Omar E. Pol, Aug 25 2021

Keywords

Comments

Note that every row ends when it is easy to know the next missing terms because they are powers of 2 or the last term and the next missing terms form a row that it is already in the sequence.
For a square array with infinitely many terms in every row, see A347270, which is a supersequence that contains all 3x+1 sequences.

Examples

			Triangle begins:
   1;
   2;
   3,  10,   5,  16;
   4;
   5,  16;
   6,   3;
   7,  22,  11,  34,  17,  52,  26,  13,  40,  20,  10,   5;
   8;
   9,  28,  14,   7;
  10,   5;
  11,  34,  17,  52,  26,  13,  40,  20,  10;
  12,   6;
  13,  40,  20,  10;
  14,   7;
  15,  46,  23,  70,  35, 106,  53, 160,  80,  40,  20,  10;
  16;
  17,  52,  26,  13;
  18,   9;
  19,  58,  29,  88,  44,  22,  11;
...
For n = 3 the 3x+1 trajectory is 3, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, ... The fourth term is 16 which is a power of 2 so the third row of the triangle is [3, 10, 5, 16].
For n = 6 the 3x+1 trajectory is 6, 3, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, ... The second term is 3 which is less than 6 so the 6th row of the triangle is [6, 3].
		

Crossrefs

Subsequence of A070165, of A235795 and of A347270.
Showing 1-3 of 3 results.