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-10 of 14 results. Next

A160198 a(n) = min(A122458(n), A159885(n)).

Original entry on oeis.org

2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 3, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 2, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 4, 1, 2
Offset: 1

Views

Author

Vladimir Shevelev, May 04 2009

Keywords

Comments

Let f(2n+1) = A000265(3n+2) be defined as in A159885. Then a(n) is the least number k of iterations such that either f^k(2n+1) < 2n+1 or A000120(f^k(2n+1)) < A000120(2n+1).
Using induction, one can prove that the Collatz (3x+1)-conjecture follows from the finiteness of a(n) for every n. - Vladimir Shevelev, May 05 2009

Crossrefs

Programs

  • Maple
    A000265 := proc(n) option remember ; local a; a := n ; while a mod 2 = 0 do a := a/2 ; end do; a; end proc:
    f := proc(n) local m ; m := (n-1)/2 ; A000265(3*m+2) ; end:
    A000120 := proc(n) local d; add(d, d=convert(n,base,2)) ; end proc:
    A159885 := proc(n) local k, twon1; k := 0 ; twon1 := 2*n+1 ; while ( A000120(twon1) > A000120(n) ) do twon1 := f(twon1) ; k := k+1 ; end do; k ; end proc:
    A122458 := proc(n) local tx1,a; a := 0 ; tx1 := 2*n+1 ; while tx1 >= 2*n+1 do if tx1 mod 2 = 0 then tx1 := tx1/2 ; else tx1 := 3*tx1+1 ; a := a+1 ; fi; end do; a ; end proc:
    A160198 := proc(n) min(A159885(n),A122458(n)) ; end: seq(A160198(n),n=1..130) ; # R. J. Mathar, May 15 2009
  • Mathematica
    a[n_] := Module[{u=2n+1, w, k=0}, w = DigitCount[u, 2, 1]; While[u >= 2n+1 && DigitCount[u, 2, 1] >= w, k++; u = (3(u-1)/2+2)/2^IntegerExponent[ (3(u-1)/2+2), 2]]; k];
    Array[a, 105] (* Jean-François Alcover, Apr 16 2020, after Antti Karttunen *)
  • PARI
    f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2);  \\ Defined for odd n only. Cf. A075677.
    A006519(n) = (1<A160198(n) = { my(u = (n+n+1), w = hammingweight(u), k=0); while((u >= (n+n+1))&&(hammingweight(u) >= w), k++; u = f(u)); (k); }; \\ Antti Karttunen, Sep 22 2018

Extensions

a(1) corrected and sequence extended by R. J. Mathar, May 15 2009

A160267 Minimum of A122458(n) and A160266(n).

Original entry on oeis.org

2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 5, 1, 1, 1, 17, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 9, 1, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 8, 1, 1, 1, 5, 1, 2, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Vladimir Shevelev, May 07 2009, May 11 2009

Keywords

Comments

Let f be the operation defined in A159885, namely f(2n+1) = A075677(n+1), and f^k its k-fold iteration.
Then a(n) is the smallest k such that either f^k(2n+1)< 2n+1 or A006694((f^k(2n+1)-1)/2) < A006694(n).

Crossrefs

Programs

  • PARI
    f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2); \\ Defined for odd n only. Cf. A075677.
    A006519(n) = (1<A006694(n) = (sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1); \\ From A006694
    A160267(n) = { my(w=A006694(n), u = (n+n+1), k=0); while((u >= (n+n+1))&&(A006694((u-1)/2) >= w), k++; u = f(u)); (k); }; \\ Antti Karttunen, Sep 22 2018

Extensions

a(47) corrected and more terms appended by R. J. Mathar, Aug 08 2010

A324248 Odd numbers with dropping time of the reduced Collatz iteration (A122458) exceeding 5.

Original entry on oeis.org

27, 31, 47, 63, 71, 91, 103, 111, 127, 155, 159, 167, 191, 207, 223, 231, 239, 251, 255, 283, 287, 303, 319, 327, 347, 359, 367, 383, 411, 415, 423, 447, 463, 479, 487, 495, 507, 511, 539, 543, 559, 575, 583, 603, 615, 623, 639, 667, 671, 679, 703, 719, 735, 743, 751, 763, 767
Offset: 1

Views

Author

Wolfdieter Lang, Feb 21 2019

Keywords

Comments

Note that the Collatz conjecture is assumed. Otherwise there may exist (very large) odd numbers for which no finite dropping time exists
This sequence is obtained from the residue classes modulo 256 of the entries a(1) to a(19): 27, 31, 47, 63, 71, 91, 103, 111, 127, 155, 159, 167, 191, 207, 223, 231, 239, 251, 255. See the Klee-Wagon reference where the function C is C(2*n+1) = A075677(n+1) = A000265(3*n+2), for n >= 0, and dropping time is called there stopping time (on p. 225 Exercise 4 should be Exercise 5 given on p. 229, with hints on p. 309; also in the first line after (1) 'less than 5' should be replaced by 'not exceeding 5').
The values of (a(j)-1)/2, for j = 1..19, are 13, 15, 23, 31, 35, 45, 51, 55, 63, 77, 79, 83, 95, 103, 111, 115, 119, 125, 127.
The dropping times are 5 for the seven residue classes modulo 256 of 39, 79, 95, 123, 175, 199, and 219. See Klee-Wagon, Exercise 5 (a), p. 229.
The dropping times for a(n) are given in A324249(n).

Examples

			n = 1: The trajectory under the reduced Collatz function fr for (a(1) - 1)/2  = 13 is given as an example in A122456, from which the dropping time is read off as 37 = A122456(13).
n = 2: The dropping time of a(2) = 31 is 35 = A122456(15). The second to last trajectory number 5 is the first number < 31.
		

References

  • Victor Klee and Stan Wagon, Old and New Unsolved Problems in Plane Geometry and Number Theory, Mathematical Association of America (1991) pp. 191-194, 225-229, 308-309.

Crossrefs

Formula

Sorted sequence of the odd numbers 2*m + 1 with least positive integer k >= 6 such that fr^[k](m) < 2*m + 1, for m >= 1, where fr is the reduced Collatz function fr(m) := A075677(m+1) = A000265(3*m+2).

A324249 Dropping times (A122458) exceeding 5 for odd numbers under reduced Collatz iteration corresponding to A324248.

Original entry on oeis.org

37, 35, 34, 34, 32, 28, 26, 19, 9, 25, 13, 18, 8, 8, 19, 7, 12, 17, 8, 15, 6, 8, 13, 13, 6, 10, 6, 7, 9, 9, 6, 25, 7, 10, 12, 17, 6, 11, 8, 8, 10, 6, 6, 10, 7, 8, 14, 15, 24, 8, 51, 8, 6, 15, 13, 12, 10, 17, 8
Offset: 1

Views

Author

Wolfdieter Lang, Feb 21 2019

Keywords

Comments

The odd numbers with dropping time >= 6 under reduced Collatz iteration are given in A324248. Note that the dropping times do not follow the modulo 256 pattern of A324248.
Note that the Collatz conjecture is assumed. Otherwise there may exist (very large) odd numbers for which no finite dropping time exists.

Examples

			a(1) = 37 for A324248(1) = 27, but a(20) = 15 for A324248(20) = 283 == 27 (mod 256) (no mod 256 pattern).
		

References

  • Victor Klee and Stan Wagon, Old and New Unsolved Problems in Plane Geometry and Number Theory, Mathematical Association of America (1991) pp. 191-194, 225-229, 308-309.

Crossrefs

Formula

a(n) = A122458((A324248(n) - 1)/2), for n >= 1.

A160266 Let f and its k-fold iteration f^k be defined as in A159885. a(n) is the least k for which A006694( (f^k(2n+1)-1)/2 ) < A006694(n).

Original entry on oeis.org

2, 1, 1, 2, 4, 2, 1, 1, 6, 1, 2, 1, 1, 5, 1, 1, 1, 6, 1, 4, 3, 1, 2, 1, 1, 2, 1, 1, 10, 5, 1, 1, 8, 1, 1, 1, 1, 1, 2, 1, 40, 1, 1, 1, 1, 1, 6, 3, 1, 7, 17, 1, 36, 1, 1, 2, 1, 1, 1, 20, 1, 1, 1, 1, 8, 1, 1, 18, 13, 1, 5, 1, 2, 6, 1, 1, 1, 1, 1, 1, 6, 1, 9, 11, 2, 9, 1, 2, 9, 4, 6, 1, 1, 1, 9, 7, 1, 7, 29, 2, 2, 1
Offset: 1

Views

Author

Vladimir Shevelev, May 07 2009

Keywords

Comments

Conjecture. For every n>=1, there exists a finite value of a(n). It is easy to see that this conjecture is equivalent to the well known Collatz 3n+1 conjecture.

Crossrefs

Programs

  • Maple
    A006519 := proc(n) local i ; for i in ifactors(n)[2] do if op(1,i) = 2 then return op(1,i)^op(2,i) ; fi ; od: return 1 ; end proc:
    f := proc(twon1) local threen2 ; threen2 := 3*twon1/2+1/2 ; threen2/A006519(threen2) ; end proc:
    A160266 := proc(n) local ref,k,fk ; ref := A006694(n) ; k := 1 ; fk := f(2*n+1) ; while true do if A006694( (fk-1)/2 ) < ref then return k; end if; fk := f(fk) ; k := k+1 ; end do ; end proc:
    seq(A160266(n),n=1..120) ; # R. J. Mathar, Feb 02 2010
  • Mathematica
    A006519[n_] := Do[If[fi[[1]] == 2, Return[2^fi[[2]]], Return[1]], {fi, FactorInteger[n]}];
    f[n_] := With[{n2 = 3 n/2 + 1/2}, n2/A006519[n2]];
    A006694[n_] := Sum[EulerPhi[d]/MultiplicativeOrder[2, d], {d, Divisors[2n + 1]}] - 1;
    a[n_] := Module[{ref, k, fk}, ref = A006694[n]; k = 1; fk = f[2n + 1]; While[True, If[A006694[(fk - 1)/2] < ref, Return[k]]; fk = f[fk]; k++]];
    Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Aug 28 2024, after R. J. Mathar *)
  • PARI
    f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2);
    A006519(n) = (1<A006694(n) = (sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1); \\ From A006694
    A160266(n) = { my(w=A006694(n), n = (n+n+1), k=0); while(A006694((n-1)/2) >= w, k++; n = f(n)); (k); }; \\ Antti Karttunen, Sep 22 2018

Extensions

More terms from R. J. Mathar, Feb 02 2010

A122791 Decimal expansion of the average "dropping time" of the reduced 3x+1 iteration.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Sep 11 2006

Keywords

Crossrefs

Cf. A122458 (dropping time of the reduced Collatz iteration), A100982, A122790.

Formula

Sum{k>0} k*A100982(k)/2^(A020914(k)-1) = 3.49265185218642491230556033752968...

A160322 a(n) = min(A160198(n), A160267(n)).

Original entry on oeis.org

2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2
Offset: 1

Views

Author

Vladimir Shevelev, May 08 2009, May 11 2009

Keywords

Comments

Let f be defined as in A159885. Then a(n) is the least k such that either f^k(2n+1))<2n+1 or A000120(f^k(2n+1)) < A000120(2n+1) or A006694((f^k(2n+1)-1)/2) < A006694(n).
In connection with A160198, A160267, A160322 we pose a new (3x+1)-problem: does there exist a finite number of sequences A_i(n), i=1,...,T, such that: 1) A_i(0)=0 and A_i(n)>0 for n>=1; 2) if B_i(n) denotes the least k for which A_i(n)>A_i((f^k(2n+1)-1)/2), then B(n)=min_{i=1,...,T}B_i(n)=1 for every n>=1? Note that this problem is weaker than (3x+1)-Collatz problem. Indeed, if the Collatz conjecture is true, then there exist nonnegative sequences A(n) for which A(0)=0 and A(n)>A((f(2n+1)-1)/2) for every n>=1 (see A160348). - Vladimir Shevelev, May 15 2009

Crossrefs

Programs

  • PARI
    f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2); \\ Defined for odd n only. Cf. A075677.
    A006519(n) = (1<A006694(n) = (sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1); \\ From A006694
    A160322(n) = { my(v=A006694(n), u = (n+n+1), w = hammingweight(u), k=0); while((u >= (n+n+1))&&(hammingweight(u) >= w)&&(A006694((u-1)/2) >= v), k++; u = f(u)); (k); }; \\ Antti Karttunen, Sep 25 2018

Formula

a(n) = min(A122458(n), A159885(n), A160266(n)). - Antti Karttunen, Sep 25 2018

Extensions

a(1) corrected and sequence extended by Antti Karttunen, Sep 25 2018

A160348 Minimal recursive sequence such that if a(n) > 0 then always a(n) > a((f(2n+1)-1)/2), where f is defined by f(2n+1) = (3n+2)/A006519(3n+2) for n>=1, that is f(m) = A075677(2*m-1) for odd m.

Original entry on oeis.org

0, 2, 1, 6, 7, 5, 3, 11, 4, 13, 14, 10, 15, 52, 12, 50, 53, 9, 54, 59, 51, 62, 63, 49, 60, 65, 8, 68, 69, 58, 16, 75, 61, 56, 76, 48, 77, 80, 64, 84, 85, 67, 78, 88, 57, 44
Offset: 0

Views

Author

Vladimir Shevelev, May 10 2009; corrected May 13 2009, May 19 2009

Keywords

Comments

If the (3x+1)-Collatz conjecture is true, then this sequence is a permutation of the nonnegative integers.

Examples

			a(0)=0. Let m=3. Then f(m)=5, f^2(m)=1. The corresponding numbers n=(m-1)/2 are 1,2,0. By the condition, a(1) > a(2) > a(0)=0. Therefore let a(2)=1, a(1)=2. Furthermore, consider m=7. Then f(m)=11, f^2(m)=17, f^3(m)=13, f^4(m)=5. The corresponding numbers n=(m-1)/2 are 3,5,8,6,2 and, by the condition, a(3) > a(5) > a(8) > a(6) > a(2)=1. Therefore set a(6)=3 (the minimal value which yet did not appear), a(8)=4, a(5)=5, a(3)=6, etc.
		

Crossrefs

Extensions

Name edited by Michel Marcus, Feb 01 2021

A381707 Smallest initial value for unimodal Collatz (3x+1)/2 glide sequence that begins with exactly n increases.

Original entry on oeis.org

5, 3, 23, 15, 95, 575, 383, 255, 5631, 25599, 104447, 69631, 745471, 3293183, 2195455, 12648447, 97910783, 65273855, 43515903, 1460666367, 6700400639, 4466933759, 71697432575, 47798288383, 764873277439, 1242923270143, 3760646520831, 8371159695359, 5580773130239, 3720515420159
Offset: 1

Views

Author

David Dewan, Mar 04 2025

Keywords

Comments

A unimodal Collatz glide sequence is successive rises x -> (3x+1)/2 followed by successive falls x -> x/2 until dropping below its starting x.
After n increases, there are ceiling(n*log(3)/log(2) - n) decreases to drop below the initial value.

Examples

			For n=3, the smallest starting x = a(3) = 23 has trajectory
  23 - 35 -> 53 ->  80  -> 40 -> 20
     \-----------/      \------/
     n=3 increases   decreases to < initial
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=2^n ModularInverse[3^n,2^Max[Ceiling[Log2[3^n]-n],2]]-1; Array[a,30]
  • PARI
    a(n)={my(m=2^(logint(3^n,2) - n + 1 + (n==1))); 2^n*lift(1/Mod(3^n,m)) - 1} \\ Andrew Howroyd, Mar 09 2025

Formula

a(n) = 2^n * (3^(-n) mod 2^max(2, ceiling(log2(3^n)-n))) - 1.

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
Showing 1-10 of 14 results. Next