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

A347270 Square array T(n,k) in which row n lists the 3x+1 sequence starting at n, read by antidiagonals upwards, with n >= 1 and k >= 0.

Original entry on oeis.org

1, 2, 4, 3, 1, 2, 4, 10, 4, 1, 5, 2, 5, 2, 4, 6, 16, 1, 16, 1, 2, 7, 3, 8, 4, 8, 4, 1, 8, 22, 10, 4, 2, 4, 2, 4, 9, 4, 11, 5, 2, 1, 2, 1, 2, 10, 28, 2, 34, 16, 1, 4, 1, 4, 1, 11, 5, 14, 1, 17, 8, 4, 2, 4, 2, 4, 12, 34, 16, 7, 4, 52, 4, 2, 1, 2, 1, 2, 13, 6, 17, 8, 22
Offset: 1

Views

Author

Omar E. Pol, Aug 25 2021

Keywords

Comments

This array gives all 3x+1 sequences.
The 3x+1 or Collatz problem is described in A006370.
Column k gives the image of n at the k-th step.
This infinite square array contains the irregular triangles A070165, A235795 and A347271.
For a piping diagram of the 3x+1 problem see A235800.

Examples

			The corner of the square array begins:
   1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
   2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, ...
   3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, ...
   4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
   5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
   6, 3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
   7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, ...
   8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
   9,28,14, 7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, ...
  10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
  11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, ...
  12, 6, 3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
  13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
  14, 7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, ...
...
		

Crossrefs

Main diagonal gives A347272.
Parity of this sequence is A347283.
Largest value in row n gives A056959.
Number of nonpowers of 2 in row n gives A208981.
Some rows n are: A153727 (n=1), A033478 (n=3), A033479 (n=9), A033480 (n=15), A033481 (n=21), A008884 (n=27), A008880 (n=33), A008878 (n=39), A008883 (n=51), A008877 (n=57), A008874 (n=63), A258056 (n=75), A258098 (n=79), A008876 (n=81), A008879 (n=87), A008875 (n=95), A008873 (n=97), A008882 (n=99), A245671 (n=1729).
First four columns k are: A000027 (k=0), A006370 (k=1), A075884 (k=2), A076536 (k=3).

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(k=0, n, (j->
          `if`(j::even, j/2, 3*j+1))(T(n, k-1)))
        end:
    seq(seq(T(d-k, k), k=0..d-1), d=1..20);  # Alois P. Heinz, Aug 25 2021
  • Mathematica
    T[n_, k_] := T[n, k] = If[k == 0, n, Function[j,
         If[EvenQ[j], j/2, 3*j + 1]][T[n, k - 1]]];
    Table[Table[T[d - k, k], {k, 0, d - 1}], {d, 1, 20}] // Flatten (* Jean-François Alcover, Mar 02 2022, after Alois P. Heinz *)

A235800 Length of n-th vertical line segment from left to right in a diagram of a two-dimensional version of the 3x+1 (or Collatz) problem.

Original entry on oeis.org

3, 1, 7, 2, 11, 3, 15, 4, 19, 5, 23, 6, 27, 7, 31, 8, 35, 9, 39, 10, 43, 11, 47, 12, 51, 13, 55, 14, 59, 15, 63, 16, 67, 17, 71, 18, 75, 19, 79, 20, 83, 21, 87, 22, 91, 23, 95, 24, 99, 25, 103, 26, 107, 27, 111, 28, 115, 29, 119, 30, 123, 31, 127, 32
Offset: 1

Views

Author

Omar E. Pol, Jan 15 2014

Keywords

Comments

In the diagram every cycle is represented by a directed graph.
After (3x + 1) the next step is (3y + 1).
After (x/2) the next step is (y/2).
A235801(n) gives the length of n-th horizontal line segment in the same diagram.
Also A004767 and A000027 interleaved.

Examples

			The first part of the diagram in the first quadrant looks like this:
. . . . . . . . . . . . . . . . . . . . . . . .
.              _ _|_ _|_ _|_ _|_ _|_ _|_ _|_ _.
.             |   |   |   |   |   |   |   |_|_.
.             |   |   |   |   |   |   |  _ _|_.
.             |   |   |   |   |   |   |_|_ _|_.
.             |   |   |   |   |   |  _ _|_ _|_.
.             |   |   |   |   |   |_|_ _|_ _|_.
.          _ _|_ _|_ _|_ _|_ _|_ _ _|_ _|_ _|_.
.         |   |   |   |   |   |_|_ _|_ _|_ _|_.
.         |   |   |   |   |  _ _|_ _|_ _|_ _|_.
.         |   |   |   |   |_|_ _|_ _|_ _|_ _|_.
.         |   |   |   |  _ _|_ _|_ _|_ _|_ _|_.
.         |   |   |   |_|_ _|_ _|_ _|_ _|_ _| .
.      _ _|_ _|_ _|_ _ _|_ _|_ _|_ _|_ _|     .
.     |   |   |   |_|_ _|_ _|_ _|_ _|         .
.     |   |   |  _ _|_ _|_ _|_ _|             .
.     |   |   |_|_ _|_ _|_ _|                 .
.     |   |  _ _|_ _|_ _|                     .
.     |   |_|_ _|_ _|                         .
.  _ _|_ _ _|_ _|                             .
. |   |_|_ _|                                 .
. |  _ _|                                     .
. |_|                                         .
. . . . . . . . . . . . . . . . . . . . . . . .
. 3,1,7,2,11...
From _Omar E. Pol_, Aug 25 2021: (Start)
The above diagram is the skeleton of a piping model of the 3x+1 or Collatz problem as shown below:
The model consists of pipes, 90-degree elbows and three types of pumps that propel the fluid through the pipes.
The corner of the infinite diagram looks like this:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
                            | |         | |         | |         | |  _ _ _  .
                            | |         | |         | |         | | |     |_.
                            | |         | |         | |         | | |  12  _.
                            | |         | |         | |        _| |_|_ v _| .
                            | |         | |         | |       |  ^  |_|_|_ _.
                            | |         | |         | |       |  11  _ _ _ _.
                            | |         | |         | |  _ _ _|_ _ _| | |   .
                 _ _ _ _ _ _|_|_ _ _ _ _|_|_ _ _ _ _|_|_|     |_ _ _ _|_|_ _.
                |  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   10  _ _ _ _ _ _ _.
                | |         | |         | |        _| |_|_ v _|       | |   .
                | |         | |         | |       |  ^  |_| |_ _ _ _ _| |_ _.
                | |         | |         | |       |  9   _| |_ _ _ _ _| |_ _.
                | |         | |         | |  _ _ _|_ _ _| | |         | |   .
                | |         | |         | | |     |_ _ _ _| |_ _ _ _ _|_|_ _.
                | |         | |         | | |  8   _ _ _ _| |_ _ _ _ _ _ _ _.
                | |         | |        _| |_|_ v _|       | |         | |   .
                | |         | |       |  ^  |_| |_ _ _ _ _| |_ _ _ _ _|_|_ _.
                | |         | |       |  7   _| |_ _ _ _ _| |_ _ _ _ _ _ _ _.
                | |         | |  _ _ _|_ _ _| | |         | |         | |   .
                | |         | | |     |_ _ _ _| |_ _ _ _ _| |_ _ _ _ _| |   .
                | |         | | |  6   _ _ _ _| |_ _ _ _ _| |_ _ _ _ _ _|   .
                | |        _| |_|_ v _|       | |         | |               .
                | |       |  ^  |_|_|_ _ _ _ _|_|_ _ _ _ _| |               .
                | |       |  5   _ _ _ _ _ _ _ _ _ _ _ _ _ _|               .
                | |  _ _ _|_ _ _| | |         | |                           .
     _ _ _ _ _ _|_|_|     |_ _ _ _|_|_ _ _ _ _| |                           .
    |  _ _ _ _ _ _ _   4   _ _ _ _ _ _ _ _ _ _ _|                           .
    | |        _| |_|_ v _|       | |                                       .
    | |       |  ^  |_| |_ _ _ _ _| |                                       .
    | |       |  3   _| |_ _ _ _ _ _|                                       .
    | |  _ _ _|_ _ _| | |                                                   .
    | | |     |_ _ _ _| |                                                   .
    | | |  2   _ _ _ _ _|                                                   .
   _| |_|_ v _|                                                             .
  |  ^  |_| |                                                               .
  |  1   _ _|                                                               .
  |_ _ _|                                                                   .
.                                                                           .
On the main diagonal of the diagram appear the pumps labeled with the positive integers (A000027).
The pumps labeled with the numbers 2, 6, 8, 12, 14, 18, 20, 24, ... (the nonzero terms of A047238) receive the fluid from the EAST and propel it in a SOUTH direction. The fluid then passes through a 90-degree elbow and then heads WEST.
The pumps labeled with the numbers 4, 10, 16, 22, 28, 34, 40, ... (A016957) are of the type "TEE" as they have two side inlets and one outlet. These receive the fluid from the EAST and from the WEST and propel it in a SOUTH direction. The fluid then passes through a 90-degree elbow and then heads WEST.
The pumps labeled with the numbers 1, 3, 5, 7, 9, 11, 13, ... (A005408) receive the fluid from the EAST and propel it in the NORTH direction. The fluid then passes through a 90-degree elbow and then heads EAST.
Starting from the n-th pump we have that the fluid makes a path equivalent to the trayectory of the 3x+1 sequence starting at n. (End)
		

Crossrefs

Cf. A347270 (all 3x+1 sequences).
Cf. Companion of A235801.

Programs

  • Mathematica
    LinearRecurrence[{0,2,0,-1},{3,1,7,2},70] (* Harvey P. Dale, Sep 29 2016 *)
  • Python
    from _future_ import division
    A235800_list = [4*(n//2) + 3 if n % 2 else n//2 for n in range(1,10**4)] # Chai Wah Wu, Sep 26 2016

Formula

a(n) = A006370(n) - A193356(n).
From Chai Wah Wu, Sep 26 2016: (Start)
a(n) = 2*a(n-2) - a(n-4) for n > 4.
G.f.: x*(x^2 + x + 3)/((x - 1)^2*(x + 1)^2). (End)

A375266 Irregular triangle read by rows in which row n lists the iterates of the A375265 map from n to 1.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 2, 1, 5, 16, 8, 4, 2, 1, 6, 2, 1, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 8, 4, 2, 1, 9, 3, 1, 10, 5, 16, 8, 4, 2, 1, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 12, 4, 2, 1, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Offset: 1

Views

Author

Paolo Xausa, Aug 08 2024

Keywords

Comments

By definition the trajectory ends when 1 is reached, so row 1 does not contain the cycle 1 -> 4 -> 2 -> 1.
See A375265 for links.

Examples

			Triangle begins:
   1;
   2,  1;
   3,  1;
   4,  2,  1;
   5, 16,  8,  4,  2,  1;
   6,  2,  1;
   7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10,  5, 16,  8,  4,  2,  1;
   8,  4,  2,  1;
   9,  3,  1;
  10,  5, 16,  8,  4,  2,  1;
  ...
		

Crossrefs

Cf. A375265, A375267 (# of iterations), A375268 (row sums), A375280 (row maxs).

Programs

  • Mathematica
    A375265[n_] := Which[Divisible[n, 3], n/3, Divisible[n, 2], n/2, True, 3*n + 1];
    Array[NestWhileList[A375265, #, # > 1 &] &, 15]

A235801 Length of n-th horizontal line segment in a diagram of a two-dimensional version of the 3x+1 (or Collatz) problem.

Original entry on oeis.org

0, 1, 2, 3, 7, 5, 6, 7, 8, 9, 17, 11, 12, 13, 14, 15, 27, 17, 18, 19, 20, 21, 37, 23, 24, 25, 26, 27, 47, 29, 30, 31, 32, 33, 57, 35, 36, 37, 38, 39, 67, 41, 42, 43, 44, 45, 77, 47, 48, 49, 50, 51, 87, 53, 54, 55, 56, 57, 97, 59, 60, 61, 62, 63, 107, 65, 66
Offset: 0

Views

Author

Omar E. Pol, Jan 15 2014

Keywords

Comments

In the diagram every cycle is represented by a directed graph.
After (3x + 1) the next step is (3y + 1).
After (x/2) the next step is (y/2).
A235800(n) gives the length of n-th vertical line segment, from left to right, in the same diagram.

Examples

			The first part of the diagram in the first quadrant:
. . . . . . . . . . . . . . . . . . . . . . . .
.              _ _|_ _|_ _|_ _|_ _|_ _|_ _|_ _.
.             |   |   |   |   |   |   |   |_|_.
.             |   |   |   |   |   |   |  _ _|_.
.             |   |   |   |   |   |   |_|_ _|_.
.             |   |   |   |   |   |  _ _|_ _|_.
.             |   |   |   |   |   |_|_ _|_ _|_.
.          _ _|_ _|_ _|_ _|_ _|_ _ _|_ _|_ _|_.
.         |   |   |   |   |   |_|_ _|_ _|_ _|_.
.         |   |   |   |   |  _ _|_ _|_ _|_ _|_.
.         |   |   |   |   |_|_ _|_ _|_ _|_ _|_.
.         |   |   |   |  _ _|_ _|_ _|_ _|_ _|_.
.         |   |   |   |_|_ _|_ _|_ _|_ _|_ _| . 11
.      _ _|_ _|_ _|_ _ _|_ _|_ _|_ _|_ _|     . 17
.     |   |   |   |_|_ _|_ _|_ _|_ _|         .  9
.     |   |   |  _ _|_ _|_ _|_ _|             .  8
.     |   |   |_|_ _|_ _|_ _|                 .  7
.     |   |  _ _|_ _|_ _|                     .  6
.     |   |_|_ _|_ _|                         .  5
.  _ _|_ _ _|_ _|                             .  7
. |   |_|_ _|                                 .  3
. |  _ _|                                     .  2
. |_|                                         .  1
. . . . . . . . . . . . . . . . . . . . . . . .  0
.                                              a(n)
.
For an explanation of this diagram as the skeleton of a piping model see A235800. - _Omar E. Pol_, Dec 30 2021
		

Crossrefs

Cf. A347270 (all 3x+1 sequences).
Companion of A235800.

Programs

  • Python
    from _future_ import division
    A235801_list = [n if n % 6 != 4 else 10*(n//6)+7 for n in range(10**4)] # Chai Wah Wu, Sep 26 2016

Formula

a(n) = 10*k - 3, if n is of the form (6*k-2), k>=1, otherwise a(n) = n.
From Chai Wah Wu, Sep 26 2016: (Start)
a(n) = 2*a(n-6) - a(n-12) for n > 11.
G.f.: x*(x^2 + 1)*(x^3 + 2*x^2 + 1)*(x^5 + x^4 + 2*x + 1)/(x^12 - 2*x^6 + 1). (End)

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.

A347653 Partial sums of the trajectory of all positive integers in the 3x+1 or Collatz problem, including the trajectory [1, 4, 2, 1] of 1.

Original entry on oeis.org

1, 5, 7, 8, 10, 11, 14, 24, 29, 45, 53, 57, 59, 60, 64, 66, 67, 72, 88, 96, 100, 102, 103, 109, 112, 122, 127, 143, 151, 155, 157, 158, 165, 187, 198, 232, 249, 301, 327, 340, 380, 400, 410, 415, 431, 439, 443, 445, 446, 454, 458, 460, 461, 470, 498, 512, 519, 541, 552, 586
Offset: 1

Views

Author

Omar E. Pol, Sep 09 2021

Keywords

Examples

			The first two rows of A235795 are [1, 4, 2, 1]; [2, 1], so a(1)..a(6) are [1, 5, 7, 8, 10, 11].
		

Crossrefs

Partial sums of A235795.
Cf. A006370, A235800, A347270 (all 3x+1 sequences).

Programs

  • Mathematica
    A235795row[n_]:=If[n==1,{1,4,2,1},NestWhileList[If[OddQ[#],3#+1,#/2]&,n,#>1&]];
    nrows=10;Accumulate[Flatten[Array[A235795row,nrows]]] (* Paolo Xausa, Jun 20 2022 *)
  • PARI
    f(n) = if (n%2, 3*n+1, n/2); \\ A014682
    row(n) = {my(list=List()); listput(list, n); until(n==1, n = f(n); listput(list, n)); Vec(list);} \\ A235795
    lista(nn) = {my(s=0, list = List()); for (n=1, nn, my(v = row(n)); for (k=1, #v, s += v[k]; listput(list, s););); Vec(list);} \\ Michel Marcus, Sep 10 2021

A347652 Records in the trajectory of all positive integers in the 3x+1 or Collatz problem, including the trajectory [1, 4, 2, 1] of 1.

Original entry on oeis.org

1, 4, 10, 16, 22, 34, 52, 70, 106, 160, 214, 322, 484, 700, 790, 1186, 1780, 2158, 3238, 4858, 7288, 9232, 13120, 17224, 17494, 26242, 39364, 41524, 45682, 68524, 77092, 97576, 98962, 148444, 167002, 250504, 354292, 504466, 756700, 851290, 1276936, 1417174, 2125762
Offset: 1

Views

Author

Omar E. Pol, Sep 09 2021

Keywords

Comments

Replacing the second term (4) with the first two primes (2, 3) we have 1, 2, 3, 10, 16, 22, ... the records in A070165.

Examples

			The first three rows of A235795 are [1, 4, 2, 1]; [2, 1]; [3, 10, 5, 16, 8, 4, 2, 1]. The records are [1, 4, 10, 16], the same as a(1)..a(4).
		

Crossrefs

Records in A235795.
Cf. A006370, A070165, A235800, A347270 (all 3x+1 sequences).

Programs

  • PARI
    f(n) = if (n%2, 3*n+1, n/2); \\ A014682
    row(n) = {my(list=List()); listput(list, n); until(n==1, n = f(n); listput(list, n)); Vec(list);} \\ A235795
    lista(nn) = {my(m=0, list = List()); for (n=1, nn, my(v = row(n)); for (k=1, #v, if (v[k]>m, m=v[k]; listput(list, m););)); Vec(list);} \\ Michel Marcus, Sep 10 2021

Extensions

More terms from Michel Marcus, Sep 10 2021

A348136 Irregular triangle read by rows T(n,k) in which row n lists the first digit of every term of the trajectory of n in Collatz problem including the trajectory [1, 4, 2, 1] for n = 1.

Original entry on oeis.org

1, 4, 2, 1, 2, 1, 3, 1, 5, 1, 8, 4, 2, 1, 4, 2, 1, 5, 1, 8, 4, 2, 1, 6, 3, 1, 5, 1, 8, 4, 2, 1, 7, 2, 1, 3, 1, 5, 2, 1, 4, 2, 1, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 9, 2, 1, 7, 2, 1, 3, 1, 5, 2, 1, 4, 2, 1, 5, 1, 8, 4, 2, 1, 1, 5, 1, 8, 4, 2, 1, 1, 3, 1, 5, 2, 1, 4, 2, 1, 5, 1, 8, 4, 2, 1, 1, 6, 3, 1, 5, 1, 8, 4, 2, 1
Offset: 1

Views

Author

Omar E. Pol, Oct 02 2021

Keywords

Examples

			Triangle begins:
1,4,2,1;
2,1;
3,1,5,1,8,4,2,1;
4,2,1;
5,1,8,4,2,1;
6,3,1,5,1,8,4,2,1;
7,2,1,3,1,5,2,1,4,2,1,5,1,8,4,2,1;
8,4,2,1;
9,2,1,7,2,1,3,1,5,2,1,4,2,1,5,1,8,4,2,1;
1,5,1,8,4,2,1;
1,3,1,5,2,1,4,2,1,5,1,8,4,2,1;
1,6,3,1,5,1,8,4,2,1;
1,4,2,1,5,1,8,4,2,1;
1,7,2,1,3,1,5,2,1,4,2,1,5,1,8,4,2,1;
...
		

Crossrefs

First digit of every term of A235795.
First column gives A000030.
Cf. A006370, A014682, A070165, A235800, A347270 (all 3x+1 sequences).

Programs

  • Mathematica
    Prepend[Map[First@ IntegerDigits[#] &, Array[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, #, # > 1 &] &, 11, 2], {2}], NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, 1, # > 1 &, {2, 1}]] // Flatten (* Michael De Vlieger, Oct 27 2021 *)

Formula

a(m) = A000030(A235795(m)), m >= 1.
T(n,k) = A000030(A235795(n,k)).
Showing 1-8 of 8 results.