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.

Previous Showing 11-14 of 14 results.

A182078 Odd numbers n such that the reduced Collatz map n -> (3n+1)/2^k gives a trajectory of decreasing odd numbers.

Original entry on oeis.org

5, 13, 17, 21, 45, 53, 69, 85, 113, 141, 181, 213, 241, 277, 301, 321, 341, 369, 401, 453, 565, 725, 753, 853, 909, 965, 1069, 1109, 1137, 1205, 1285, 1365, 1425, 1477, 1605, 1713, 1813, 1933, 1969, 2261, 2417, 2573, 2577, 2625, 2901, 2957, 3013, 3213, 3413
Offset: 1

Views

Author

Michel Lagneau, Apr 10 2012

Keywords

Examples

			45 is in the sequence because 45 generates the trajectory of odd numbers : 45 -> 17 -> -> 13 -> 5 -> 1.
		

Crossrefs

Cf. A006666, A075677 (reduced Collatz map), A256598 (trajectory).

Programs

  • Maple
    for n from 3 by 2 to 5000 do:i:=0:x:=n:n0:=n: u0:=0:for it from 1 to 1000 while(n0<>1 and u0=0) do: for a from 1 to 100 while(x mod 2 = 0 ) do: i:=i+1:x:=x/2: od:if x > n0 then u0:=1:else i:=i+1:n0:=x :x:=3*n0+1: fi:od: if u0=0 then printf(`%d, `,n):else fi:od:

A349954 a(n) is the number of extrema that result from iterating the reduced Collatz function R(k) = A139391(k) on 2n-1 to yield 1.

Original entry on oeis.org

0, 2, 1, 2, 3, 2, 1, 2, 1, 4, 1, 2, 5, 20, 3, 18, 5, 2, 3, 8, 19, 4, 1, 18, 3, 4, 1, 20, 5, 8, 3, 18, 3, 6, 1, 18, 21, 2, 3, 6, 3, 20, 1, 4, 7, 16, 3, 18, 21, 4, 5, 14, 7, 18, 19, 10, 1, 4, 3, 6, 17, 12, 19, 4, 21, 4, 5, 6, 15, 10, 1, 18, 19, 22, 3, 2, 5, 14
Offset: 1

Views

Author

Ya-Ping Lu, Mar 11 2022

Keywords

Comments

The trajectory starts with a minimum for odd n and with a maximum (see A351974) for even n (>=2). Since the trajectory always stops at 1 (a minimum) assuming the Collatz conjecture holds, a(n) is odd if n is odd and vice versa.

Examples

			a(10) = 4 because 2n+1 = 19 and iterating R on 19 gives 4 extrema:
19 -> 29 -> 11 -> 17 -> 1
      max   min   max   min.
The corresponding path of n, 10 -> 15 -> 6 -> 9 -> 1, is shown in the tree below, where the paths for n up to 100 are given and a(n) is the depth from n to 1.
                                       n                                      a(n)
----------------------------------------------------------------------------- ----
                                                    98     74                  22
                                             37 49 147 65 111                  21
                        14                86  \__\__28_/   42  100             20
                     95 21  55 73 83  97 129        63_____/   225             19
                  54 36  \___\__\__\___\__16        24          48  32 72      18
                   \__\____________________\________81     61  243__/__/       17
                                                     \______\___46  92         16
                                                                69 207         15
                                                                52  78         14
                                                               117__/          13
                                      62                        88             12
                                      93                       297             11
                                      70            94          84  56         10
                                     105  79       141         189__/           9
                                  20  30__/        106         142              8
                                   \__45           159 53      213              7
         68                           34            60 40  90  160  80          6
     29 153    77           85    13  51  17 67 89 135_/___/  1215 405          5
      \__22 50 58 44 66 26  64 96  \__10__/__/__/__/       82  456 304          4
5 19 25  33 75 87 99_/  39 729_/  59  15               47 123 1539__/  31 41    3
\__\__\___\__\__\__4     \___6____/___/   76 38  2   8 18   \___12_____/__/     2
                   \_________9 11 43  71 171 57  3   \__\_______27  91 35 23 7  1
                             \__\__\___\___\__\__\_______________1__/__/__/__/  0
		

Crossrefs

Programs

  • Python
    def R(k): c = 3*k+1; return c//(c&-c)
    def A349954(n):
        if n == 1: return 0
        ct = 1; m = R(2*n-1); d = m - 2*n + 1
        while m > 1:
            if (R(m) - m)*d < 0: ct += 1; d = -d
            m = R(m)
        return ct

A351123 Irregular triangle read by rows: row n lists the partial sums of the number of divisions by 2 after each tripling step in the Collatz trajectory of 2n+1.

Original entry on oeis.org

1, 5, 4, 1, 2, 4, 7, 11, 2, 3, 4, 6, 9, 13, 1, 3, 6, 10, 3, 7, 1, 2, 3, 8, 12, 2, 5, 9, 1, 4, 5, 7, 10, 14, 6, 1, 2, 7, 11, 2, 3, 6, 7, 9, 12, 16, 1, 3, 4, 5, 6, 7, 9, 11, 12, 14, 15, 16, 18, 19, 20, 21, 23, 26, 27, 28, 30, 31, 33, 34, 35, 36, 37, 38, 41, 42, 43, 44, 48, 50, 52, 56, 59, 60, 61, 66, 70
Offset: 1

Views

Author

Flávio V. Fernandes, Feb 01 2022

Keywords

Comments

The terms in row n are T(n,0), T(n,1), ..., T(n, A258145(n)-2), and are the partial sums of the terms in row n of A351122.
In each row n, the terms also satisfy the equation 3* (3* (3* (3* ... (3* (2n+1) +1) + 2^T(n,0)) + 2^T(n,1)) + 2^T(n,2)) + ... = 2^T(n, A258145(n)-2); e.g., for n=4, and A258145(4)-2=5: 3* (3* (3* (3* (3* (3*9+1) +2^2) +2^3) +2^4) +2^6) +2^9 = 2^13.
For row n, the right-hand side of the equation above is 2^A166549(n+1). E.g., for the above example (n=4), the right-hand side is 2^A166549(4+1) = 2^13.

Examples

			Triangle starts at T(1,0):
n\k   0   1   2   3   4   5   6   7   8   9   10 ...
1:    1   5
2:    4
3:    1   2   4   7  11
4:    2   3   4   6   9  13
5:    1   3   6  10
6:    3   7
7:    1   2   3   8   12
8:    2   5   9
...
E.g., row 3 of A351122 is [1, 1, 2, 3, 4]; its partial sums are [1, 2, 4, 7, 11].
		

Crossrefs

Programs

  • PARI
    orow(n) = my(m=2*n+1, list=List()); while (m != 1, if (m%2, m = 3*m+1, my(nb = valuation(m,2)); m/=2^nb; listput(list, nb));); Vec(list); \\ A351122
    row(n) = my(v = orow(n)); vector(#v, k, sum(i=1, k, v[i])); \\ Michel Marcus, Jul 18 2022

Extensions

Data corrected by Mohsen Maesumi, Jul 18 2022
Last row completed by Michel Marcus, Jul 18 2022

A317083 a(n) is the first term less than the initial 2n+1 in the reduced Collatz trajectory.

Original entry on oeis.org

1, 1, 1, 5, 7, 5, 5, 5, 13, 11, 1, 5, 19, 23, 11, 23, 25, 5, 7, 19, 31, 37, 17, 23, 37, 29, 5, 47, 43, 19, 23, 61, 49, 19, 13, 61, 55, 1, 29, 19, 61, 47, 1, 37, 67, 61, 35, 91, 73, 7, 19, 61, 79, 91, 41, 61, 85, 65, 11, 101, 91, 59, 47, 77, 97, 37, 25, 43, 103
Offset: 0

Views

Author

Michel Lagneau, Jul 21 2018

Keywords

Examples

			a(3)= 5 because, starting with 7, the iteration produces 11,17,13,5 and 5 is the first term less than 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=NestWhileList[(3*#+1)/2^IntegerExponent[3*#+1,2]&,2*n+1,#>1&];
    nextOddK[n_]:=Module[{m=3n+1},While[EvenQ[m],m=m/2];m];dt[n_]:=Module[{m=n,cnt=0},If[n>1,While[m=nextOddK[m];cnt++;m>n]];cnt];
    Table[Part[f[i],dt[2i+1]+1],{i,0,70}]
Previous Showing 11-14 of 14 results.