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 21-30 of 46 results. Next

A257499 Array A read by upward antidiagonals in which the entry in row n and column k is defined by A(n,k) = (1 + 2^n*(6*k-3+2*(-1)^n))/3, n,k >= 1.

Original entry on oeis.org

1, 7, 5, 3, 15, 9, 27, 19, 23, 13, 11, 59, 35, 31, 17, 107, 75, 91, 51, 39, 21, 43, 235, 139, 123, 67, 47, 25, 427, 299, 363, 203, 155, 83, 55, 29, 171, 939, 555, 491, 267, 187, 99, 63, 33, 1707, 1195, 1451, 811, 619, 331, 219, 115, 71, 37
Offset: 1

Views

Author

L. Edson Jeffery, Apr 27 2015

Keywords

Comments

Conjecture (now Lemma 1): The sequence is a permutation of the odd natural numbers.
Proof from Max Alekseyev, Apr 29 2015:
Reformulating the conjecture, we need to prove that for any integer m >= 0, the equation (1 + 2^n*(6*k - 3 + 2*(-1)^n))/3 = 2*m + 1 has a unique solution in integers n,k >= 1. Simplifying a bit, we have
(1) 2^n*(6*k - 3 + 2*(-1)^n) = 6*m + 2.
Since the factor (6*k - 3 + 2*(-1)^n) is odd, n is uniquely defined by n = A007814(6*m+2). Since 6*m+2 is even, we have n>=1. Dividing (1) by 2^n and rearranging, we further get
(2) 6*k = (6*m + 2)/2^n + 3 - 2*(-1)^n.
To prove the uniqueness of k, it remains to prove that the r.h.s of (2) is divisible by 6. To that end, the value of n implies that (6*m + 2)/2^n is odd; hence the r.h.s. of (2) is even and thus divisible by 2. Now, taking the r.h.s. modulo 3, we get
(6*m + 2)/2^n + 3 - 2*(-1)^n == 2/(-1)^n + 0 - 2*(-1)^n == 0 (mod 3);
so the r.h.s. of (2) is also divisible by 3. Therefore k is uniquely defined by
k = ((6*m + 2)/2^n + 3 - 2*(-1)^n)/6.
Finally, it is easy to see that (6*m + 2)/2^n >= 1, so k >= 1.
QED
Let v(y) denote the 2-adic valuation of y (see A007814). For x an odd natural number, define the function F(x) = (3*x+1)/2^v(3*x+1) (see A075677). Let F^(j)(x) denote k-fold iteration of F and defined by the recurrence F^(j)(x) = F(F^(j-1)(x)), j>0, with initial condition F^(0)(x) = x.
Lemma 2: The following statements are equivalent. (i) Row n of A is the set of all odd m such that F^(n)(4*m-3) == 1 (mod 4); (ii) Row n of A is the set of all odd m such that v(1+F(4m-3)) = n.

Examples

			Array A begins:
.       1     5     9    13    17     21     25     29     33     37
.       7    15    23    31    39     47     55     63     71     79
.       3    19    35    51    67     83     99    115    131    147
.      27    59    91   123   155    187    219    251    283    315
.      11    75   139   203   267    331    395    459    523    587
.     107   235   363   491   619    747    875   1003   1131   1259
.      43   299   555   811  1067   1323   1579   1835   2091   2347
.     427   939  1451  1963  2475   2987   3499   4011   4523   5035
.     171  1195  2219  3243  4267   5291   6315   7339   8363   9387
.    1707  3755  5803  7851  9899  11947  13995  16043  18091  20139
		

Crossrefs

Cf. A255138 (column 1).

Programs

  • Mathematica
    (* Array: *)
    Grid[Table[(1 + 2^n*(6*k - 3 + 2*(-1)^n))/3, {n, 10}, {k, 10}]]
    (* Array antidiagonals flattened: *)
    Flatten[Table[(1 + 2^(n - k + 1)*(6*k - 3 + 2*(-1)^(n - k + 1)))/3, {n, 10}, {k, n}]]

A075684 For odd numbers 2n-1, the maximum number produced by iterating the reduced Collatz function R defined as R(k) = (3k+1)/2^r, with r as large as possible.

Original entry on oeis.org

1, 5, 5, 17, 17, 17, 13, 53, 17, 29, 21, 53, 29, 3077, 29, 3077, 33, 53, 37, 101, 3077, 65, 45, 3077, 49, 77, 53, 3077, 65, 101, 61, 3077, 65, 101, 69, 3077, 3077, 113, 77, 269, 81, 3077, 85, 197, 101, 3077, 93, 3077, 3077, 149, 101, 3077, 269, 3077, 3077, 3077
Offset: 1

Views

Author

T. D. Noe, Sep 25 2002

Keywords

Comments

See A075677 for the function R applied to the odd numbers once. See A075680 for the number of iterations required to yield 1. Sequence A006884, with the number 2 removed, gives the odd numbers that produce new record maxima. The maxima of the current sequence are related to A006885: if m is a maximum of the usual Collatz iteration, then (m-1)/3 is the maximum for the reduced Collatz iteration.

Examples

			a(4) = 17 because 7 is the fourth odd number and 17 is the largest number in the iteration: R(7)=11, R(11)=17, R(17)=13, R(13)=5, R(5)=1.
		

Crossrefs

Programs

  • Mathematica
    nextOddK[n_] := Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[m=n; maxK=n; If[n>1, While[m=nextOddK[m]; maxK=Max[m, maxK]; m!=1]]; maxK, {n, 1, 200, 2}]

A260590 The modified Syracuse algorithm, msa, applied to 2n+1.

Original entry on oeis.org

4, 2, 7, 2, 5, 2, 7, 2, 4, 2, 5, 2, 59, 2, 56, 2, 4, 2, 8, 2, 5, 2, 54, 2, 4, 2, 5, 2, 7, 2, 54, 2, 4, 2, 51, 2, 5, 2, 8, 2, 4, 2, 5, 2, 45, 2, 8, 2, 4, 2, 42, 2, 5, 2, 31, 2, 4, 2, 5, 2, 8, 2, 15, 2, 4, 2, 7, 2, 5, 2, 7, 2, 4, 2, 5, 2, 40, 2, 21, 2, 4, 2, 29, 2, 5, 2, 8, 2, 4, 2, 5, 2, 7, 2, 13
Offset: 1

Views

Author

Joseph K. Horn and Robert G. Wilson v, Jul 29 2015

Keywords

Comments

Normally the '3x+1 problem' or 'Collatz problem' asks for the number of steps to go from n to 1 (A006577). Here we ask for the number of iterations of the mapping, msa, to go from n to less than n; the mapping of x is either -> (3x+1)/2 if x is odd or -> x/2 if x is even.
Since the number of iterations of msa for an even number is always 1, we will only investigate the odd numbers greater than one.
a(n) = 1 for no values of n;
a(n) = 2 for n = 2 + 2k (k=0,1,2,3,...);
a(n) = 3 for no values of n;
a(n) = 4 for n = 1 + 8k (k=0,1,2,3,...);
a(n) = 5 for n = 5 + 16k and 11 + 16k (k=0,1,2,3,...);
a(n) = 6 for no values of n;
a(n) = 7 for n = 3 + 64k, 7 + 64k, 29 + 64k, etc. (k=0,1,2,3,...).
Possible values for a(n) are: 2, 4, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 24, 26, 27, 29, ... (A260593, sorted). Density is ~ 5/8.
Record values: 4, 7, 59, 81, 105, 135, 164, 165, 173, 176, 183, 224, 246, 287, 292, 298, 308, 376, 395, 398, 433, 447, 547, ....
And the records occur for n: 1, 3, 13, 351, 5043, 17827, 135135, 181171, 190863, 313165, 513715, 563007, 4044031, 6710835, 10319167, 13358335, 28462477, 31864063, 108870007, 600495895, 913698783, 1394004493, ....
Remember these n-values are the indices of odd numbers (A005408).

Examples

			a(1) is 4 because 2n+1 is 3 and 3 -> 5 -> 8 -> 4 -> 2. The number of iterations of the msa is 4;
a(2) is 2 because 2n+1 is 5 and 5 -> 8 -> 4. The number of iterations of the msa is 2;
a(3) is 7 because 2n+2 is 7 and 7 -> 11 -> 17 -> 26 -> 13 -> 20 -> 10 -> 5. The number of iterations of the msa is 7; etc.
Also see The Modified Syracuse Algorithm link.
		

Crossrefs

Programs

  • Mathematica
    msa[n_] := If[ OddQ@ n, (3n + 1)/2, n/2]; f[n_] := Block[{k = 2n + 1}, Length@ NestWhileList[ msa@# &, k, # >= k &] - 1]; Array[f, 95]

Formula

a(n) = the number of iterations for the msa; i.e., the number of mappings of x -> (3x+1)/2 if x is odd or -> x/2 if x is even to arrive at a number less than n.
a(n) = the binary length of A260592(n).

A371095 Array A read by upward antidiagonals in which the entry A(n,k) in row n and column k is defined by A(1, k) = 8*k-7, and A(n+1, k) = R(A(n, k)), n,k >= 1, where Reduced Collatz function R(n) gives the odd part of 3n+1.

Original entry on oeis.org

1, 1, 9, 1, 7, 17, 1, 11, 13, 25, 1, 17, 5, 19, 33, 1, 13, 1, 29, 25, 41, 1, 5, 1, 11, 19, 31, 49, 1, 1, 1, 17, 29, 47, 37, 57, 1, 1, 1, 13, 11, 71, 7, 43, 65, 1, 1, 1, 5, 17, 107, 11, 65, 49, 73, 1, 1, 1, 1, 13, 161, 17, 49, 37, 55, 81, 1, 1, 1, 1, 5, 121, 13, 37, 7, 83, 61, 89, 1, 1, 1, 1, 1, 91, 5, 7, 11, 125, 23, 67, 97
Offset: 1

Views

Author

Antti Karttunen, Apr 24 2024

Keywords

Examples

			Array begins:
n\k|  1   2   3   4   5    6   7   8   9   10  11   12   13   14   15   16
---+------------------------------------------------------------------------
1  |  1,  9, 17, 25, 33,  41, 49, 57, 65,  73, 81,  89,  97, 105, 113, 121,
2  |  1,  7, 13, 19, 25,  31, 37, 43, 49,  55, 61,  67,  73,  79,  85,  91,
3  |  1, 11,  5, 29, 19,  47,  7, 65, 37,  83, 23, 101,  55, 119,   1, 137,
4  |  1, 17,  1, 11, 29,  71, 11, 49,  7, 125, 35,  19,  83, 179,   1, 103,
5  |  1, 13,  1, 17, 11, 107, 17, 37, 11,  47, 53,  29, 125, 269,   1, 155,
6  |  1,  5,  1, 13, 17, 161, 13,  7, 17,  71,  5,  11,  47, 101,   1, 233,
7  |  1,  1,  1,  5, 13, 121,  5, 11, 13, 107,  1,  17,  71,  19,   1, 175,
8  |  1,  1,  1,  1,  5,  91,  1, 17,  5, 161,  1,  13, 107,  29,   1, 263,
9  |  1,  1,  1,  1,  1, 137,  1, 13,  1, 121,  1,   5, 161,  11,   1, 395,
10 |  1,  1,  1,  1,  1, 103,  1,  5,  1,  91,  1,   1, 121,  17,   1, 593,
11 |  1,  1,  1,  1,  1, 155,  1,  1,  1, 137,  1,   1,  91,  13,   1, 445,
12 |  1,  1,  1,  1,  1, 233,  1,  1,  1, 103,  1,   1, 137,   5,   1, 167,
13 |  1,  1,  1,  1,  1, 175,  1,  1,  1, 155,  1,   1, 103,   1,   1, 251,
14 |  1,  1,  1,  1,  1, 263,  1,  1,  1, 233,  1,   1, 155,   1,   1, 377,
15 |  1,  1,  1,  1,  1, 395,  1,  1,  1, 175,  1,   1, 233,   1,   1, 283,
16 |  1,  1,  1,  1,  1, 593,  1,  1,  1, 263,  1,   1, 175,   1,   1, 425,
		

Crossrefs

Cf. A017077 (row 1), A016921 (row 2), A075677.
Cf. also A371096, A371097.

Programs

  • PARI
    up_to = 91;
    R(n) = { n = 1+3*n; n>>valuation(n, 2); };
    A371095sq(n,k) = if(1==n,8*k-7,R(A371095sq(n-1,k)));
    A371095list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A371095sq((a-(col-1)),col))); (v); };
    v371095 = A371095list(up_to);
    A371095(n) = v371095[n];

A372361 Array read by upward antidiagonals: A(n, k) = A372358(A372283(n, k)), n,k >= 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 4, 0, 0, 0, 4, 2, 6, 0, 0, 0, 0, 6, 4, 0, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 22, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 22, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 14
Offset: 1

Views

Author

Antti Karttunen, May 01 2024

Keywords

Examples

			Array begins:
n\k| 1  2  3  4  5  6  7   8  9 10 11  12  13   14 15   16  17  18  19  20
---+------------------------------------------------------------------------
1  | 0, 0, 0, 2, 4, 6, 0,  2, 4, 6, 0,  2, 12,  14, 8,  10, 20, 22, 16, 18,
2  | 0, 0, 0, 6, 2, 4, 0,  2, 0, 8, 0, 22,  6,  28, 6,  26, 12,  0,  2, 14,
3  | 0, 0, 0, 4, 6, 0, 0, 22, 0, 6, 0,  0,  8,  10, 4,  18,  6,  0,  6, 12,
4  | 0, 0, 0, 0, 4, 0, 0,  0, 0, 4, 0,  0,  6,  26, 0,  62,  8,  0,  4, 22,
5  | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  4,  18, 0, 116,  6,  0,  0, 48,
6  | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  62, 0,  44,  4,  0,  0,  6,
7  | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 116, 0,  14,  0,  0,  0,  8,
8  | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  44, 0,  92,  0,  0,  0,  6,
9  | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  14, 0,  50,  0,  0,  0,  4,
10 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  92, 0,  78,  0,  0,  0,  0,
11 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  50, 0,  60,  0,  0,  0,  0,
12 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  78, 0, 122,  0,  0,  0,  0,
13 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  60, 0,  82,  0,  0,  0,  0,
14 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 122, 0, 222,  0,  0,  0,  0,
15 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  82, 0, 260,  0,  0,  0,  0,
16 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 222, 0, 232,  0,  0,  0,  0,
17 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 260, 0, 114,  0,  0,  0,  0,
18 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 232, 0,  46,  0,  0,  0,  0,
19 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0, 114, 0,  44,  0,  0,  0,  0,
20 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  46, 0,  78,  0,  0,  0,  0,
21 | 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,  0,  0,  44, 0, 252,  0,  0,  0,  0,
		

Crossrefs

Cf. A075677, A086893, A372283, A372358, A372360 (binary weights), A372446 (column 14).
Cf. also A372359.

Programs

A372446 a(n) = A372358(A372443(n)).

Original entry on oeis.org

14, 28, 10, 26, 18, 62, 116, 44, 14, 92, 50, 78, 60, 122, 82, 222, 260, 232, 114, 46, 44, 78, 252, 106, 138, 410, 354, 774, 1064, 218, 2, 1366, 336, 276, 228, 16, 8, 2, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, May 03 2024

Keywords

Comments

These are the bitmasks (or symmetric differences) obtained when the n-th iterate of 27 with Reduced Collatz-function R [= A372443(n), where R(n) = A000265(3*n+1)] is xored with that term of A086893 that has the same binary length. The binary expansions of the terms of A086893 are always of the form 10101...0101 (i.e., alternating 1's and 0's starting and ending with 1) when the binary length is odd, and of the form 110101...0101 (i.e., 1 followed by alternating 1's and 0's, and ending with 1) when n is even. Note that for all n >= 1, R(A086893(2n-1)) = 1, and R(A086893(2n)) = 5 (with R(5) = 1), so the first zero here, a(39) = 0 indicates that the iteration will soon have reached the terminal 1, and indeed, A372443(41) = 1.

Crossrefs

Column 14 of A372361.

Programs

A255138 a(n) = (1 + 2^n*(3 + 2*(-1)^n))/3.

Original entry on oeis.org

2, 1, 7, 3, 27, 11, 107, 43, 427, 171, 1707, 683, 6827, 2731, 27307, 10923, 109227, 43691, 436907, 174763, 1747627, 699051, 6990507, 2796203, 27962027, 11184811, 111848107, 44739243, 447392427, 178956971
Offset: 0

Views

Author

L. Edson Jeffery, May 04 2015

Keywords

Comments

Let N_1 be the set of odd natural numbers and v(y) the 2-adic valuation of y. Define the map F : N_1 -> N_1 by F(x) = (3*x+1)/2^v(3*x+1) (see A075677). Let F^(k)(x) denote k-fold iteration of F, with recurrence F^(k)(x) = F(F^(k-1)(x)), k > 0, and initial condition F^(0)(x) = x. Then, for n>0, a(n) is the least m such that F^(n)(4*m-3) == 1 (mod 4). Cf. A257499.
Let k == 1 mod 4, and k(r) be the r-th iteration at which k appears in a Collatz sequence. When n >= 2 and k(r) == [2^(n+1) - a(n)] mod 2^(n+1), then n is the number of halving steps following k(r+1). For instance, since a(5) = 11, there are 5 halving steps following k(r+1) when k(r) == 53 mod 64, because 2^(5+1) = 64 and 64-11 = 53; e.g., k(r) = 117: 117 -> 352 -> 176 -> 88 -> 44 -> 22 -> 11. - Bob Selcoe, Feb 09 2017

Crossrefs

Programs

  • Magma
    [(1 + 2^n*(3 + 2*(-1)^n))/3: n in [0..50]]; // Wesley Ivan Hurt, Nov 05 2015
  • Maple
    A255138:=n->(1 + 2^n*(3 + 2*(-1)^n))/3: seq(A255138(n), n=0..50); # Wesley Ivan Hurt, Nov 05 2015
  • Mathematica
    a[n_] := (1 + 2^n*(3 + 2*(-1)^n))/3; Table[a[n], {n, 0, 29}]
    LinearRecurrence[{1,4,-4},{2,1,7},30] (* Harvey P. Dale, Aug 03 2024 *)
  • PARI
    vector(30, n, n--; (1 + 2^n*(3 + 2*(-1)^n))/3) \\ Altug Alkan, Nov 05 2015
    

Formula

a(2*n) = A136412(n); a(2*n+1) = A007583(n).
G.f.: (2-x-2*x^2)/((x-1)*(2*x-1)*(2*x+1)). - R. J. Mathar, Jul 25 2015
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n > 2. - Wesley Ivan Hurt, Nov 05 2015
a(n) = 4*a(n-2) - 1. - Bob Selcoe, Feb 09 2017
a(n) = 2^(n+1) - A096773(n+1). - Ruud H.G. van Tol, Sep 04 2023

A324036 Modified reduced Collatz map fs acting on positive odd integers.

Original entry on oeis.org

1, 5, 1, 11, 7, 17, 3, 23, 13, 29, 5, 35, 19, 41, 7, 47, 25, 53, 9, 59, 31, 65, 11, 71, 37, 77, 13, 83, 43, 89, 15, 95, 49, 101, 17, 107, 55, 113, 19, 119, 61, 125, 21, 131, 67, 137, 23, 143, 73, 149, 25, 155, 79, 161, 27, 167, 85, 173, 29, 179, 91, 185, 31, 191, 97, 197, 33, 203, 103, 209
Offset: 0

Views

Author

Nicolas Vaillant, Philippe Delarue, Wolfdieter Lang, May 08 2019

Keywords

Comments

This is a modification of the reduced Collatz map given in A075677.
The Collatz conjecture is that iteration of the map fs leads to 1 for all positive odd integers.
In the Vaillant-Delarue (V-D) reference the present map fs: Odd -> Odd, 2*n+1 -> a(n) = fs(2*n+1), for n >= 0, is called f_{s}. The differences from b(n) = A075677(n+1) = fCr(2*n+1) (called f_{cr} in V-D) occur for the positions n = 2 + 4*k, for k >= 1: b(2 + 4*k) = b(k) = A075677(k+1) but a(2 + 4*k) = 1 + 2*k, which differs.
The advantage of the map fs (or a) over fCr (or b) is an explicit formula over a recurrence.
Additional steps are introduced in the iteration of fs versus fCr. This leads to an incomplete binary tree, called CfsTree, given in A324038. No such tree is available for fCr.
Such additional steps in fs can only occur after odd numbers congruent to 5 modulo 8: fs(5 + 8*k) = a(2 + 4*k) = 1 + 2*k and fs(1 + 2*k) = a(k). On the other hand, fCr(5 + 8*k) = b(2 + 4*k) = b(k).
The appearance of exactly N consecutive steps in fs versus fCr, for N >= 2, can be shown recursively to start with the odd numbers O(N;k) = 1 + 4*O(N-1;k), for N >= 3, with input O(2;k) = 53 + (4^3)*k. These are the numbers O(N;k) = A072197(N) + A000302(N+1)*k, for N >= 2. Therefore only one additional step follows directly after an odd number 5 (mod 8) if it is not of the O(N;k) type for N >= 2.
The minimal number of iterations of function fs acting on 2*n + 1 (or a acting on n), for n >= 0, to reach 1 is given in A324037 (if for very large n the number 1 should not be reached A324037(n) is set to -1).

Examples

			Iteration of fs on 11: 11, 17, 13, 3, 5, 1, whereas for fCr: 11, 17, 13 , 5, 1. The additional step (N = 1) occurs for 13 == 5 (mod 8), and 13 does not belong to the O(N;k) sets for N >= 2.
The first additional N = 2 steps occur for 53 = a(26): 53, 13, 3, 5, 1, versus iteration of fCr: 53, 5, 1. Such N = 2 steps occur precisely after 53 + 64*k as 13 + 16*k and 3 + 4*k.
The first additional N = 3 steps occur for 213 = a(106): 213, 53, 13, 3, 5, 1 versus 213, 5, 1 for fCr.
The first additional N = 4 steps occur for 853 = a(426): 853, 213, 53, 13, 3, 5, 1 versus 853, 5, 1 for fCr.
		

Crossrefs

Programs

  • PARI
    a(n) = my(m=Mod(n,4)); if (m==0, (2 + 3*n)/2, if (m==2, n/2, 2 + 3*n)); \\ Michel Marcus, Aug 10 2023

Formula

a(n) = fs(1 + 2*n) = (2 + 3*n)/2 if n == 0 (mod 4), a(n) = 2 + 3*n, for n == 1 or 3 (mod 4), and a(n) = n/2 if n == 2 (mod 4). This corresponds to fs(1 + 8*k) = 1 + 6*k, fs(3 + 8*k) = 5 + 12*k, fs(5 + 8*k) = 1 + 2*k, and fs(7 + 8*k) = 11 + 12*k, for k >= 0.
Conjectures from Colin Barker, Oct 14 2019: (Start)
G.f.: (1 + 5*x + x^2 + 11*x^3 + 5*x^4 + 7*x^5 + x^6 + x^7) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2).
a(n) = 2*a(n-4) - a(n-8) for n>7.
(End)

Extensions

More terms from Michel Marcus, Aug 10 2023

A337349 To get a(n), take 3*n+1 and divide out any power of 2; then multiply by 3, subtract 1 and divide out any power of 2.

Original entry on oeis.org

1, 1, 5, 7, 19, 1, 7, 1, 37, 5, 23, 25, 55, 7, 1, 17, 73, 19, 41, 43, 91, 1, 25, 13, 109, 7, 59, 61, 127, 1, 17, 35, 145, 37, 77, 79, 163, 5, 43, 11, 181, 23, 95, 97, 199, 25, 13, 53, 217, 55, 113, 115, 235, 7, 61, 31, 253, 1, 131, 133, 271, 17, 35, 71, 289, 73, 149
Offset: 0

Views

Author

N. J. A. Sloane, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006

Keywords

Comments

When a(x) is iterated, what are the limit cycles? Are there any besides (1) and (17 -> 19 -> 43 -> 97 -> 109 -> 61)?
Up to 1000000000 every number eventually reaches one of those two cycles. In this range, the longest trajectory starts with n=458788881 and takes 193 steps to reach 1. - Christian Boyer (cboyer(AT)club-internet.fr), Sep 16 2006

Crossrefs

Cf. A102421 (bisection), A102423.

Programs

  • Maple
    A337349 := proc(n)
        local a;
        a := 3*n+1;
        while modp(a,2) = 0 do
            a := a/2 ;
        end do:
        a := 3*a-1 ;
        while modp(a,2) = 0 do
            a := a/2 ;
        end do:
        a ;
    end proc: # R. J. Mathar, Aug 24 2020
  • Mathematica
    a[n_] := Module[{k = 3n+1}, k = k/2^IntegerExponent[k, 2]; k = 3k-1; k = k/2^IntegerExponent[k, 2]; k];
    a /@ Range[0, 100] (* Jean-François Alcover, Aug 27 2020 *)

Formula

a(n) = A075677(A067745(n+1)).
a(2*n+1) = A102421(n).

A347840 A surjective map of the positive numbers congruent to 5 modulo 8 (A004770) to the positive numbers congruent to 1, 3, or 7 modulo 8 (A047529).

Original entry on oeis.org

1, 3, 1, 7, 9, 11, 3, 15, 17, 19, 1, 23, 25, 27, 7, 31, 33, 35, 9, 39, 41, 43, 11, 47, 49, 51, 3, 55, 57, 59, 15, 63, 65, 67, 17, 71, 73, 75, 19, 79, 81, 83, 1, 87, 89, 91, 23, 95, 97, 99, 25, 103, 105, 107, 27, 111, 113, 115, 7, 119, 121
Offset: 1

Views

Author

Wolfdieter Lang, Oct 30 2021

Keywords

Comments

This map is obtained from the array A(k, m) given in A347834. There all positive numbers congruent to 5 modulo 8 (A004770) appear uniquely in the columns for m >= 1, and the m = 0 column gives all numbers congruent to {1, 3, 7} (mod 8) (A047529). The surjective map is f: A004770 -> A047529, with b(n) = A004770(n) -> f(b(n)) = a(n).
See also the array A178415 which has permuted rows.
This maps all entries of each row k of the array A(k, m), given in A347834, with columns m >= 1 to the entry A(k, 0) = A047529(k), for k >= 1. The numbers b(n) appear once in the array A for columns m >= 1. Column A(k, 1) = A347836(k) gives the numbers congruent to {5, 32, 29} (mod 32), and each entry for columns m >= 2 is congruent to 21 (mod 32).
The surjective map of the numbers b(n) = 5 + 8*(n-1) = A004770(n), for n >= 1, to A047529 with element a(n), is computed by switching to the companion array A347839 of A347834, with the simple recurrence, removing all factors of 4, and then going back to array A347834. See the formula below. Thanks to Antti Karttunen for motivating me to simplify the prescription, and to add in A347834 the hint for the induction proof that all 5 (mod 8) numbers appear once in the columns n >= 1.
This map f is of interest in the context of the Collatz 3*n+1 conjecture. The (modified) rooted tree with only odd labeled nodes has for each row k of the array A(k, m) (A347834) the same precursor (or (modified) Collatz map given in A075677(n+1), for 2*n+1). Therefore, all nodes with labels b(n) == 5 (mod 8) can be represented by a(n). This leads to a further restricted Collatz tree with only node labels congruent to {1, 3, 7} (mod 8) (A047529).
An even further restricted Collatz tree has only node labels congruent to 1 (mod 8) (A017077), as any positive integer can be written as m*2^(v+1)+2^v-1 or (m,v) where v is the number of trailing 1-bits in binary, and for v > 1 the next odd Collatz successor of (m,v) is (3*m+1,v-1). - Ruud H.G. van Tol, Sep 13 2023

Examples

			The sequence a(n) begins: (b(n) = A004770(n))
-------------------------------------------------------------------------
n:     1  2  3  4  5  6  7  8  9 10 11 12  13  14  15  16  17  18  19  20
b(n):  5 13 21 29 37 45 53 61 69 77 85 93 101 109 117 125 133 141 149 157
a(n):  1  3  1  7  9 11  3 15 17 19  1 23  25  27   7  31  35  35   9  39
-------------------------------------------------------------------------
n:     21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37 ...
b(n): 165 173 181 189 197 205 213 221 229 237 245 253 261 269 277 285 293 ...
a(n):  41  43  11  47  49  51   3  55  57  59  15  63  65  67  17  71  73 ...
-----------------------------------------------------------------------------
n = 6, b(6) = 45 = 13 + 32*1, case a), a(6) = 3 + 8*1 = 11.
n = 7, b(7) = 53 = 21 + 32*1, case b)1), first instance, L(7) = 0, a(7) = 3 + 8*0 = 3.
n = 31, b(31) = 245 = 117 + 128*1, case b)1), second instance, L(31) = 1, a(31) = 7 + 8*1 = 15.
n = 11, b(11) = 85 = 21 + 64*1, A065883(1 + 3*1) = 1, c(11) = 1, case b)2)i), a(11) = 85 = A347834(1, 3).
n = 19, b(19) = 149 = 21 + 64*2, A065883(1 + 3*2) = 7, c(19) = (7 - 1)/3 = 2, case b)2)ii), a(n) = 4*2 + 1 = 9.
		

Crossrefs

Programs

  • Mathematica
    A347840[n_] := NestWhile[Quotient[#, 4] &, 2*n - 1, Mod[#, 8] == 5 &];
    Array[A347840, 100] (* Paolo Xausa, Jun 25 2025 *)
  • PARI
    a(n) = n=2*n-1; while(5==n%8, n>>=2); n; \\ Ruud H.G. van Tol, Sep 13 2023
    
  • PARI
    a(n) = (2*n-1)>>(valuation(3*n-1,2)\2*2); \\ Ruud H.G. van Tol, Sep 20 2023

Formula

a(n) = (2*A065883((3*b(n)+1)/2) - 1)/3, with b(n) = A004770(n), for n >= 1.
a(n) = A385109(8*(n-1)+5). - Ralf Stephan, Jun 18 2025
Previous Showing 21-30 of 46 results. Next