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

A074473 Dropping time for the 3x+1 problem: for n >= 2, number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated starting at n; a(1)=1 by convention.

Original entry on oeis.org

1, 2, 7, 2, 4, 2, 12, 2, 4, 2, 9, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 97, 2, 4, 2, 92, 2, 4, 2, 7, 2, 4, 2, 14, 2, 4, 2, 9, 2, 4, 2, 89, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 12, 2, 4, 2, 89, 2, 4, 2, 7, 2, 4, 2, 84, 2, 4, 2, 9, 2, 4, 2, 14, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 74, 2, 4, 2, 14, 2, 4, 2, 7
Offset: 1

Views

Author

Labos Elemer, Sep 19 2002

Keywords

Comments

Here we call the starting value iteration number 1, although usually the count is started at 0, which would subtract 1 from the values for n >= 2 - see A060445, A102419.

Examples

			n=2k: then a(2k)=2 because the second iterate is k<n=2k, the first iterate below 2k; n=4k+1, k>1: the list = {4k+1, 12k+4, 6k+2, 3k+1, ...} i.e. the 4th term is always the first below initial value, so a(4k+1)=4;
n=15: the list={15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1} and 12th term is first sinks below iv=15, so a(15)=12; relatively larger values occur at n=4k+3.
n=3: the list is {3, 10, 5, 16, 8, 4, 2, 1, ..}, the 7th term is 2, which is the first smaller than 3, so a(3)=7.
		

Crossrefs

Programs

  • Mathematica
    nextx[x_Integer] := If[OddQ@x, 3x + 1, x/2]; f[1] = 1; f[n_] := Length@ NestWhileList[nextx, n, # >= n &]; Array[f, 83] (* Bobby R. Treat (drbob(at)bigfoot.com), Sep 16 2006 *)
  • PARI
    A074473(n) = if (n<3, n,  my(N=n, x=1); while (1, if (n%2==0, n/=2, n = 3*n + 1); x++; if (nMichel Marcus, Aug 15 2025
  • Python
    def a(n):
        if n<3: return n
        N=n
        x=1
        while True:
            if n%2==0: n/=2
            else: n = 3*n + 1
            x+=1
            if nIndranil Ghosh, Apr 15 2017
    

Extensions

Edited by N. J. A. Sloane, Sep 15 2006

A075483 Number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated, starting with numbers of form 64n+63.

Original entry on oeis.org

89, 25, 22, 22, 35, 20, 66, 30, 17, 38, 133, 27, 25, 40, 35, 30, 20, 25, 22, 38, 38, 133, 51, 27, 17, 40, 22, 30, 20, 35, 22, 95, 131, 33, 20, 25, 27, 22, 27, 66, 17, 27, 71, 45, 33, 48, 35, 89, 22, 33, 30, 30, 48, 22, 40, 30, 17, 61, 30, 64, 22, 22, 25, 84, 22, 22, 25, 33
Offset: 0

Views

Author

Labos Elemer, Sep 24 2002

Keywords

Comments

1stSubmergeLengths[=A074473] with initial values belonging to other residue classes modulo 64 are either listed in A075476-A075483 or can be easily determined. For 64k+2s the first sink below initial value is at 2nd iterate; for 64k+4s+1 the first submerge below initial value comes at 4th term of iteration list; finally if initial value is of 64k+4s+3 form or moreover initial value = 64k+r, r = 3, 11, 19, 23, 35, 43, 51, 55, then for all k first sink emerges at the 7th, 9th, 7th, 9th, 7th, 9th, 7th, 9th iterates, respectively.

Examples

			n=8: 64n + 63 = 575, the list = the 17th term 410 < 575 = initial value, so a(8)=17.
		

Crossrefs

Programs

  • Mathematica
    Table[Function[k, Length@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, k, # >= k &]][64 n - 1], {n, 120}] (* Michael De Vlieger, Feb 20 2017 *)

Formula

a(n) = A074473(64n + 63).

A075477 Number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated, starting with numbers of form 64n+15. Corresponds to selection of every 16th term from A074474.

Original entry on oeis.org

12, 14, 12, 22, 12, 14, 12, 20, 12, 14, 12, 22, 12, 14, 12, 17, 12, 14, 12, 20, 12, 14, 12, 40, 12, 14, 12, 58, 12, 14, 12, 17, 12, 14, 12, 33, 12, 14, 12, 33, 12, 14, 12, 25, 12, 14, 12, 17, 12, 14, 12, 33, 12, 14, 12, 27, 12, 14, 12, 40, 12, 14, 12, 17, 12, 14, 12, 69, 12
Offset: 0

Views

Author

Labos Elemer, Sep 23 2002

Keywords

Comments

Remark that initial values of form 64m+r, if r={3,11,19,27,35,43,51,55} provide first-sink-lengths {7,9,7,9,7,9,7,9} respectively; e.g. {64k+19,192k+58,96k+29,288k+88,144k+44,72k+22,36k+11} submerge first below initial value at the 7th term,36k+11<64k+19.

Examples

			n=0: 64n+15=15,list={15,46,23,70,35,106,53,160,80,40,20,10..}, i.e. the 12th term is the first that <15, the initial value.
		

Crossrefs

Programs

Formula

a(n) = A074473(64n+15), n=0..256. [corrected by Antti Karttunen, Oct 09 2018]

A075478 Number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated, starting with numbers of form 64n+27. Corresponds to selection of every 16th term from A074474.

Original entry on oeis.org

97, 74, 66, 14, 40, 17, 25, 14, 22, 27, 40, 14, 45, 27, 17, 14, 40, 38, 27, 14, 56, 17, 20, 14, 22, 27, 30, 14, 100, 30, 17, 14, 22, 33, 20, 14, 22, 17, 30, 14, 20, 30, 53, 14, 38, 20, 17, 14, 51, 25, 66, 14, 35, 17, 22, 14, 25, 20, 64, 14, 38, 40, 17, 14, 45, 25, 22, 14, 27
Offset: 0

Views

Author

Labos Elemer, Sep 23 2002

Keywords

Comments

Remark that initial values of form 64m+r, if r={3,11,19,27,35,43,51,55} provide first-sink-lengths {7,9,7,9,7,9,7,9} respectively; e.g. {64k+19,192k+58,96k+29,288k+88,144k+44,72k+22,36k+11} submerge first below initial value at the 7th term,36k+11<64k+19.

Examples

			n=0: 64n+27=27, list={27, 82, 41, 46.23.70, ..}, i.e. the 97th term is the first that <27, the initial value.
		

Crossrefs

Formula

a(n)=A075473[64n+27], n=0, ..., 256

A075479 Number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated, starting with numbers of form 64n+31. Corresponds to selection of every 16th term from A074474.

Original entry on oeis.org

92, 14, 35, 51, 17, 14, 25, 27, 22, 14, 64, 17, 22, 14, 61, 43, 131, 14, 27, 22, 17, 14, 33, 35, 22, 14, 53, 17, 20, 14, 43, 22, 22, 14, 45, 22, 17, 14, 35, 43, 20, 14, 25, 17, 25, 14, 20, 22, 27, 14, 38, 20, 17, 14, 27, 22, 30, 14, 25, 17, 33, 14, 40, 20, 69, 14, 115, 27, 17
Offset: 0

Views

Author

Labos Elemer, Sep 23 2002

Keywords

Comments

Remark that initial values of form 64m+r, if r={3,11,19,27,35,43,51,55} provide first-sink-lengths {7,9,7,9,7,9,7,9} respectively; e.g. {64k+19,192k+58,96k+29,288k+88,144k+44,72k+22,36k+11} submerge first below initial value at the 7th term,36k+11<64k+19.

Examples

			n=1: 64n+31=95,list={95,286,143,430,215,646,323,970, 485,1456,728,364,182,91,274,...}, i.e. the 14th term=91 is the first that <95, the initial value, so a(1)=14.
		

Crossrefs

Formula

a(n)=A075473[64n+31], n=0, ..., 256
Showing 1-5 of 5 results.