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.

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).

A365478 In the Collatz problem, largest value in the trajectory of n in the 3x+1 function (denoted by T(x) in the literature, and defined as T(x) = (3x+1)/2 if x is odd, T(x) = x/2 if x is even), or -1 if the trajectory is divergent.

Original entry on oeis.org

1, 2, 8, 4, 8, 8, 26, 8, 26, 10, 26, 12, 20, 26, 80, 16, 26, 26, 44, 20, 32, 26, 80, 24, 44, 26, 4616, 28, 44, 80, 4616, 32, 50, 34, 80, 36, 56, 44, 152, 40, 4616, 42, 98, 44, 68, 80, 4616, 48, 74, 50, 116, 52, 80, 4616, 4616, 56, 98, 58, 152, 80, 92, 4616, 4616
Offset: 1

Views

Author

Paolo Xausa, Sep 05 2023

Keywords

Comments

This sequence differs from A025586, where the division by 2 does not immediately follow the 3x+1 step when x is odd.
Here by definition the trajectory ends when 1 is reached, so a(1) = 1.
Kontorovich and Lagarias (2009, 2010) call these values the maximum excursion values.

Examples

			a(11) = 26 because 26 is the largest value in the trajectory 11 -> 17 -> 26 -> 13 -> 20 -> 10 -> 5 -> 8 -> 4 -> 2 -> 1.
		

Crossrefs

Cf. A014682, A025586 (equivalent for the Collatz function), A166245.

Programs

  • Mathematica
    A365478[n_]:=Max[NestWhileList[If[OddQ[#],(3#+1)/2,#/2]&,n,#>1&]];Array[A365478,100]

Formula

a(n) <= A025586(n).

A349325 Number of times the Collatz plot started at n crosses the y = n line, or -1 if the number of crossings is infinite.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 4, 1, 4, 1, 2, 1, 2, 5, 2, 1, 4, 5, 6, 1, 2, 3, 2, 1, 6, 1, 4, 1, 2, 3, 4, 1, 6, 1, 2, 1, 2, 3, 4, 1, 6, 1, 4, 1, 2, 3, 4, 1, 4, 1, 2, 1, 2, 7, 6, 1, 6, 1, 2, 3, 4, 7, 6, 1, 4, 1, 2, 1, 2, 3, 6, 1, 10, 1, 2, 1, 2, 5, 2, 1, 4, 5, 6, 1, 2, 3, 2
Offset: 1

Views

Author

Paolo Xausa, Nov 15 2021

Keywords

Comments

The plots considered are the trajectories from n to 1 of the 3x+1 function, denoted by T(x) in the literature, defined as T(x) = (3x+1)/2 if x is odd, T(x) = x/2 if x is even (A014682).
The starting value of the trajectory is considered a crossing.
A similar sequence for the "standard" Collatz function (A006370) is A304030.
Conjecture: every positive integer appears in the sequence infinitely many times.

Examples

			The trajectory starting at 7 is 7 -> 11 -> 17 -> 26 -> 13 -> 20 -> 10 -> 5 -> 8 -> 4 -> 2 -> 1, so the Collatz plot crosses the y = 7 line at the beginning, from 10 to 5, from 5 to 8 and from 8 to 4, for a total of 4 times. a(7) is therefore 4.
		

References

  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, American Mathematical Society, 2010.

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[h=1;prevc=c=n;While[c>1,If[OddQ[c],c=(3c+1)/2;If[prevcn,h++],c/=2^IntegerExponent[c,2];If[prevc>n&&c
    				
  • PARI
    f(n) = if (n%2, (3*n+1)/2, n/2); \\ A014682
    a(n) = {my(nb=1, prec=n, next); while (prec != 1, next = f(prec); if ((next-n)*(prec-n) <0, nb++); prec = next;); nb;} \\ Michel Marcus, Nov 16 2021
  • Python
    def A349325(n):
        prevc = c = n
        h = 1
        while c > 1:
            if c % 2:
                c = (3*c+1) // 2
                if prevc < n and c > n: h += 1
            else:
                c //= 2
                if prevc > n and c < n: h += 1
            prevc = c
        return h
    print([A349325(n) for n in range(1, 100)])
    

Formula

a(2^k) = 1, for integers k >= 0.
a(A166245(m)) = 1 for m>=1. - Michel Marcus, Nov 16 2021

A087262 Integer quotient of largest and initial values in 3x+1 iteration, started at n.

Original entry on oeis.org

1, 1, 5, 1, 3, 2, 7, 1, 5, 1, 4, 1, 3, 3, 10, 1, 3, 2, 4, 1, 3, 2, 6, 1, 3, 1, 341, 1, 3, 5, 297, 1, 3, 1, 4, 1, 3, 2, 7, 1, 225, 1, 4, 1, 3, 3, 196, 1, 3, 1, 4, 1, 3, 170, 167, 1, 3, 1, 5, 2, 3, 148, 146, 1, 3, 1, 4, 1, 3, 2, 130, 1, 126, 1, 4, 1, 3, 3, 10, 1, 3, 112, 111, 1, 3, 2, 6, 1, 3, 1, 101
Offset: 1

Views

Author

Labos Elemer, Sep 11 2003

Keywords

Comments

Remarkably often, several consecutive terms are identical or close, showing closeness of peaks too: at n=107-111, a(n)=83-86.
If a(n)=1, then the peak is the start-value (per A166245).
It is conjectured that if peak/initial value is an integer then it equals 1.

Crossrefs

Cf. A025586, A056959, A166245 (indices of 1's).

Programs

  • Mathematica
    c[x_] := (1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1)c[1]=1; fpl[x_] := Delete[FixedPointList[c, x], -1] Table[Floor[Max[fpl[w]]/w//N], {w, 1, 256}]

Formula

a(n) = floor(A025586(n)/n).
Showing 1-4 of 4 results.