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

A324245 The modified Collatz map considered by Vaillant and Delarue.

Original entry on oeis.org

0, 2, 0, 5, 3, 8, 1, 11, 6, 14, 2, 17, 9, 20, 3, 23, 12, 26, 4, 29, 15, 32, 5, 35, 18, 38, 6, 41, 21, 44, 7, 47, 24, 50, 8, 53, 27, 56, 9, 59, 30, 62, 10, 65, 33, 68, 11, 71, 36, 74, 12, 77, 39, 80, 13, 83, 42, 86, 14, 89, 45, 92, 15, 95, 48, 98, 16, 101, 51, 104, 17, 107, 54, 110, 18, 113, 57, 116, 19, 119, 60
Offset: 0

Views

Author

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

Keywords

Comments

This is a modified Collatz-Terras map (A060322), called in the Vaillant and Delarue link f.
The Collatz conjecture: iterations of the map f = a: N_0 -> N_0 with n -> a(n) lead always to 0.
The minimal number k with a^{[k]}(n) = 0 is given by A324037(n).
The tree CfTree, related to this map, giving the branches which lead to 0 for each vertex label of level n >= 0 is given in A324246.

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[OddQ@n,(3n+1)/2,If[Mod[n,4]==0,3n/4,(n-2)/4]];Array[a,51,0] (* Giorgos Kalogeropoulos, Dec 08 2021 *)
  • PARI
    A324245(n) = if(n%2, (1+3*n)/2, if(!(n%4), 3*(n/4), (n-2)/4)); \\ (After Mathematica-code) - Antti Karttunen, Dec 09 2021

Formula

a(n) = (3*n+1)/2 if n is odd, 3*n/4 if n == 0 (mod 4), and (n-2)/4 if n == 2 (mod 4).
a(n) = A349414(n) + n. - Ruud H.G. van Tol, Dec 08 2021
G.f.: x*(2 + 5*x^2 + 3*x^3 + 4*x^4 + x^5 + x^6)/(1 - x^4)^2. - Stefano Spezia, Dec 08 2021

Extensions

More terms from Antti Karttunen, Dec 09 2021

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

A246425 In the Collatz 3x+1 problem: start at an odd number 2n+1 and find the next odd number 2m+1 in the trajectory; then a(n) = m-n.

Original entry on oeis.org

0, 1, -2, 2, -1, 3, -4, 4, -2, 5, -10, 6, -3, 7, -9, 8, -4, 9, -15, 10, -5, 11, -14, 12, -6, 13, -24, 14, -7, 15, -19, 16, -8, 17, -28, 18, -9, 19, -24, 20, -10, 21, -42, 22, -11, 23, -29, 24, -12, 25, -41, 26, -13, 27, -34, 28, -14, 29, -53, 30, -15, 31, -39, 32, -16, 33, -54, 34, -17, 35, -44, 36, -18, 37, -71, 38, -19, 39, -49, 40, -20, 41, -67, 42, -21, 43, -54, 44, -22, 45, -82, 46, -23, 47, -59, 48, -24, 49, -80, 50
Offset: 0

Views

Author

K. G. Stier, Aug 26 2014

Keywords

Comments

Positive terms indicate the next odd number 2m+1 in the trajectory is greater than 2n+1 which is the case every second time giving a(n) = m-n = (n+1)/2.
Negative terms indicate the next odd number 2m+1 in the trajectory is smaller than 2n+1. For behavior of this part refer to A087230.

Examples

			a(14)=-9 because 2*14 + 1 = 29 and the Collatz trajectory to reach the next odd number goes: 29, 88, 44, 22, 11. Thus, m=5 and 5 - 14 = -9.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m;
       m:= 6*n+4;
       m/2^(1+padic:-ordp(m,2))-n-1/2
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 22 2020
  • Mathematica
    a[n_] := ((6n+4)/2^IntegerExponent[6n+4, 2] - (2n+1))/2;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 15 2023 *)
  • PARI
    forstep(n=0, 1000, 1, m=6*n+4; print1(((m/2^valuation(m, 2)-(2*n+1))/2),", "))

Formula

a(n) = ((6*n+4)/2^A087230(n) - (2*n+1))/2.

A329480 a(n) = (1 - A075677(n))/6 if 6|(A075677(n)-1) or a(n) = (A075677(n) + 1)/6 if 6|(A075677(n)+1).

Original entry on oeis.org

0, 1, 0, 2, -1, 3, 1, 4, -2, 5, 0, 6, -3, 7, 2, 8, -4, 9, -1, 10, -5, 11, 3, 12, -6, 13, 1, 14, -7, 15, 4, 16, -8, 17, -2, 18, -9, 19, 5, 20, -10, 21, 0, 22, -11, 23, 6, 24, -12, 25, -3, 26, -13, 27, 7, 28, -14, 29, 2, 30, -15, 31, 8, 32, -16, 33, -4, 34, -17
Offset: 1

Views

Author

Fabian S. Reid, Jun 07 2020

Keywords

Comments

A fractal sequence.
This sequence is related to the Collatz Problem and can be illustrated on a logarithmic spiral to determine the odd numbers in the trajectory of a natural number of the form 6x+1 or 6x-1 simply by moving forward if the integer is positive, backward if the integer is negative, and continuing this forward-backward movement indefinitely.
When formatted as a table T with 4 columns, the third column T(n,3) is equal to the sequence. - Ruud H.G. van Tol, Oct 16 2023

Examples

			For n = 2, A075677(2) = 5, so a(2) = 1.
For n = 9, A075677(9) = 13, so a(9) = -2.
From _Ruud H.G. van Tol_, Oct 16 2023: (Start)
Array T begins:
 n|k_1|__2|__3|__4|
 1|  0   1   0   2
 2| -1   3   1   4
 3| -2   5   0   6
 4| -3   7   2   8
 5| -4   9  -1  10
 6| -5  11   3  12
... (End)
		

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[r=(c=3(2n-1)+1)/2^IntegerExponent[c,2];If[Mod[r,6]==1,(1-r)/6,(1+r)/6],{n, nterms}] (* Paolo Xausa, Nov 28 2021 *)
  • PARI
    a(n) = my(x=3*n-1); x>>=valuation(x, 2); if(1==x%6, 1-x, 1+x)/6; \\ Ruud H.G. van Tol, Oct 16 2023

Formula

a(n) = (1 - A075677(n))/6 when 1 = A075677(n) mod 6, or
a(n) = (A075677(n) + 1)/6 when 5 = A075677(n) mod 6.
From Ruud H.G. van Tol, Oct 16 2023: (Start)
a(4*n-1) = a(n).
T(n,1) = 1-n; T(n,2) = 2*n-1 = n - T(n,1); T(n,3) = T(floor((n-1)/4) + 1, (n-1) mod 4 + 1) = a(n); T(n,4) = 2*n = T(n,2) + 1. (End)
Showing 1-4 of 4 results.