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 11-20 of 26 results. Next

A062057 Numbers with 7 odd integers in their Collatz (or 3x+1) trajectory.

Original entry on oeis.org

9, 18, 19, 36, 37, 38, 72, 74, 76, 77, 81, 144, 148, 149, 152, 154, 162, 163, 288, 296, 298, 304, 308, 309, 321, 324, 325, 326, 331, 576, 592, 596, 597, 608, 616, 618, 625, 642, 643, 648, 650, 652, 653, 662, 663, 713, 715, 1152, 1184, 1192, 1194, 1216, 1232, 1236, 1237
Offset: 1

Views

Author

Keywords

Comments

The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd.
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
A078719(a(n)) = 7; A006667(a(n)) = 6.

Examples

			The Collatz trajectory of 9 is (9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 7 odd integers.
		

References

  • J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.

Crossrefs

Column k=7 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062057 n = a062057_list !! (n-1)
    a062057_list = map (+ 1) $ elemIndices 7 a078719_list
    -- Reinhard Zumkeller, Oct 08 2011
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countOdd[lst_] := Length[Select[lst, OddQ]]; Select[Range[1000], countOdd[Collatz[#]] == 7 &] (* T. D. Noe, Dec 03 2012 *)

A062058 Numbers with 8 odd integers in their Collatz (or 3x+1) trajectory.

Original entry on oeis.org

25, 49, 50, 51, 98, 99, 100, 101, 102, 196, 197, 198, 200, 202, 204, 205, 217, 392, 394, 396, 397, 400, 404, 405, 408, 410, 433, 434, 435, 441, 475, 784, 788, 789, 792, 794, 800, 808, 810, 816, 820, 821, 833, 857, 866, 867, 868, 869, 870, 875, 882, 883, 950, 951, 953
Offset: 1

Views

Author

Keywords

Comments

The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd.
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
A078719(a(n)) = 8; A006667(a(n)) = 7.

Examples

			The Collatz trajectory of 25 is (25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 8 odd integers.
		

References

  • J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.

Crossrefs

Column k=8 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062058 n = a062058_list !! (n-1)
    a062058_list = map (+ 1) $ elemIndices 8 a078719_list
    -- Reinhard Zumkeller, Oct 08 2011
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countOdd[lst_] := Length[Select[lst, OddQ]]; Select[Range[1000], countOdd[Collatz[#]] == 8 &] (* T. D. Noe, Dec 03 2012 *)

A062059 Numbers with 9 odd integers in their Collatz (or 3x+1) trajectory.

Original entry on oeis.org

33, 65, 66, 67, 130, 131, 132, 133, 134, 260, 261, 262, 264, 266, 268, 269, 273, 289, 520, 522, 524, 525, 528, 529, 532, 533, 536, 538, 546, 547, 555, 571, 577, 578, 579, 583, 633, 635, 1040, 1044, 1045, 1048, 1050, 1056, 1058, 1059, 1064, 1066, 1072, 1076, 1077
Offset: 1

Views

Author

Keywords

Comments

The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd.
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
A078719(a(n)) = 9; A006667(a(n)) = 8.

Examples

			The Collatz trajectory of 33 is (33, 100, 50, 25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 9 odd integers.
		

References

  • J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a062059 n = a062059_list !! (n-1)
    a062059_list = map (+ 1) $ elemIndices 9 a078719_list
    -- Reinhard Zumkeller, Oct 08 2011
    
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countOdd[lst_] := Length[Select[lst, OddQ]]; Select[Range[1000], countOdd[Collatz[#]] == 9 &] (* T. D. Noe, Dec 03 2012 *)
  • Python
    def a(n):
        l=[n, ]
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            if n not in l:
                l+=[n, ]
                if n<2: break
            else: break
        return len([i for i in l if i%2])
    [n for n in range(30, 1101) if a(n)==9] # Indranil Ghosh, Apr 14 2017

A062054 Numbers with 4 odd integers in their Collatz (or 3x+1) trajectory.

Original entry on oeis.org

17, 34, 35, 68, 69, 70, 75, 136, 138, 140, 141, 150, 151, 272, 276, 277, 280, 282, 300, 301, 302, 544, 552, 554, 560, 564, 565, 600, 602, 604, 605, 1088, 1104, 1108, 1109, 1120, 1128, 1130, 1137, 1200, 1204, 1205, 1208, 1210, 2176, 2208, 2216, 2218, 2240
Offset: 1

Views

Author

Keywords

Comments

The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd.
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
A078719(a(n)) = 4; A006667(a(n)) = 3.
Numbers m such that (s0 - 4s1)/2m = 1 where s0 is the sum of the even elements and s1 the sum of the odd elements in the Collatz trajectory of m. - Michel Lagneau, Aug 13 2018
If m is in the sequence then so is 2*m, so one would only have to check odd numbers. - David A. Corneth, Aug 13 2018

Examples

			The Collatz trajectory of 17 is (17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 4 odd integers. - _Jeffrey R. Goodwin_, Oct 26 2011
		

References

  • J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.

Crossrefs

Programs

Formula

The twelve formulas giving this sequence are listed in Corollary 3.3 in J. R. Goodwin with the following caveats: the value x cannot equal zero in formulas (3.16) and (3.20), one must multiply the formulas by all powers of 2 (2^1, 2^2, ...) to get the evens. - Jeffrey R. Goodwin, Oct 26 2011

A286380 a(n) = the minimum number of iterations of the reduced Collatz function R required to yield 1. The function R (A139391) is defined as R(k) = (3k+1)/2^r, with r as large as possible.

Original entry on oeis.org

0, 1, 2, 1, 1, 3, 5, 1, 6, 2, 4, 3, 2, 6, 5, 1, 3, 7, 6, 2, 1, 5, 4, 3, 7, 3, 41, 6, 5, 6, 39, 1, 8, 4, 3, 7, 6, 7, 11, 2, 40, 2, 9, 5, 4, 5, 38, 3, 7, 8, 7, 3, 2, 42, 41, 6, 10, 6, 10, 6, 5, 40, 39, 1, 8, 9, 8, 4, 3, 4, 37, 7, 42, 7, 3, 7, 6, 12, 11, 2, 6, 41, 40, 2, 1, 10, 9, 5, 9, 5, 33, 5, 4, 39, 38, 3, 43, 8, 7, 8, 7, 8, 31, 3, 12, 3, 36, 42, 41, 42, 24
Offset: 1

Views

Author

Antti Karttunen, May 08 2017

Keywords

Crossrefs

Cf. A075680 (the odd bisection).

Programs

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A139391(n)).
Other identities. For all n >= 1:
a(n) + A000035(n) = A078719(n).

A334040 Number of odd numbers larger than n in the Collatz trajectory of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 3, 0, 3, 0, 2, 0, 0, 1, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 38, 0, 0, 2, 36, 0, 0, 0, 1, 0, 0, 0, 4, 0, 35, 0, 2, 0, 0, 1, 34, 0, 0, 0, 1, 0, 0, 33, 35, 0, 1, 0, 3, 0, 0, 32, 33, 0, 0, 0, 1, 0, 0, 0, 31, 0, 33, 0, 2, 0, 0, 2, 4, 0, 0, 31, 32
Offset: 1

Views

Author

Hamid Kulosman, May 11 2020

Keywords

Examples

			For n=7 the Collatz process is: 7,22,(11),34,(17),52,26,(13),40,20,10,5,16,8,4,2,1. The numbers in the parentheses are odd numbers in the Collatz process for n=7 that are bigger than 7. There are three of them, hence a(7)=3.
		

Crossrefs

Programs

A380244 The Collatz (or 3x+1) trajectory starting at a(n) contains exactly n odd integers and a(n) is the n-th number with this property.

Original entry on oeis.org

1, 10, 12, 68, 45, 30, 72, 101, 134, 179, 237, 314, 422, 551, 723, 509, 1282, 887, 1170, 1535, 2021, 1509, 1899, 2412, 1780, 2217, 3170, 3867, 2819, 3728, 2511, 3155, 3972, 2802, 3578, 2623, 3444, 4302, 3087, 3968, 2690, 1806, 2336, 1593, 2084, 2757, 1884, 2477
Offset: 1

Views

Author

Alois P. Heinz, Jan 17 2025

Keywords

Examples

			a(2) = 10 is the second integer (after 5) having exactly two odd integers in the Collatz trajectory: 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1.
		

Crossrefs

Main diagonal of A354236.

Programs

  • Maple
    b:= proc(n) option remember; irem(n, 2, 'r')+
          `if`(n=1, 0, b(`if`(n::odd, 3*n+1, r)))
        end:
    A:= proc() local h, p, q; p, q:= proc() [] end, 0;
          proc(n, k)
            if k=1 then return 2^(n-1) fi;
            while nops(p(k)) A(n$2):
    seq(a(n), n=1..48);

Formula

A078719(a(n)) = n.

A346965 a(n) is the number of ascending subsequences in reducing n to 1 using the Collatz reduction, or -1 if n refutes the Collatz conjecture.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 3, 0, 4, 1, 3, 1, 2, 3, 2, 0, 3, 4, 4, 1, 1, 3, 2, 1, 5, 2, 17, 3, 4, 2, 16, 0, 6, 3, 2, 4, 4, 4, 6, 1, 17, 1, 6, 3, 4, 2, 16, 1, 5, 5, 5, 2, 2, 17, 17, 3, 7, 4, 6, 2, 3, 16, 15, 0, 6, 6, 5, 3, 3, 2, 16, 4, 18, 4, 2, 4, 5, 6, 6, 1, 4, 17, 17
Offset: 1

Views

Author

Douglas Boffey, Aug 09 2021

Keywords

Comments

In this sequence, a subsequence is considered ascending for as long as a (3*n + 1) / 2 step is required.

Examples

			a(9) = 4, viz.
  9->14;
  14->7->11->17->26;
  26->13->20;
  20->10->5->8.
		

Crossrefs

Programs

  • C
    /* A007814 */
    int num_clear_bits(unsigned n) {
      if (n == 0)
        return -1;
      return log2(n & -n);
    }
    int A346965(unsigned n) {
      int x;
      int result = 0;
      n >>= num_clear_bits(n);
      while (n > 1) {
        x = num_clear_bits(n + 1);
        n = ((n >> x) + 1) * pow(3, x) - 1;
        n >>= num_clear_bits(n);
        ++result;
      }
      return result;
    }

Formula

a(2^n) = 0.
a((2^n*(2*x+1)-1) * 2^y) = a(3^n*(2*x+1)-1) + 1, where x, y >= 0.
a(n) = a(A085062(n)) + (n mod 2) for n >= 2. - Alan Michael Gómez Calderón, Feb 09 2025
a(n) = A160541(A000265(n)). - Alan Michael Gómez Calderón, Mar 19 2025

A078720 Integer part of the ratio of even to odd terms among n, f(n), f(f(n)), ...., 1 for the Collatz function (that is, until reaching "1" for the first time), or -1 if 1 is never reached.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 5, 2, 2, 2, 2, 2, 2, 1, 3, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 3, 3, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 6, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 4, 2, 1, 1, 4, 4, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 3, 1, 2, 2, 2
Offset: 1

Views

Author

Joseph L. Pe, Dec 20 2002

Keywords

Comments

1. The Collatz function (related to the "3x+1 problem") is defined by: f(n) = n/2 if n is even; f(n) = 3n + 1 if n is odd. A famous conjecture states that n, f(n), f(f(n)), .... eventually reaches 1. 2. It appears that a(n) > 0 for all n. The mean of {a(1), a(2), ...., a(N)} seems to be close to 3/2 for large N. That is, there are about 3 even to 2 odd terms in N, f(N), f(f(N)), ...., 1. Hence f1(n) = n/2 will be applied about three times and f2(n) = 3n+1 about two times, in N, f(N), f(f(N)), ...., 1. Heuristically, one can see why 1 must eventually be reached by N, f(N), f(f(N)), .... For example, considering a sample sequence of 3 applications of f1 and 2 applications of f2: f1(f1(f1(f2(f2(N))))) = (9/32)N + 5/16, which makes N much smaller.

Examples

			The terms n, f(n), f(f(n)), ...., 1 for n = 12 are: 12, 6, 3, 10, 5, 16, 8, 4, 2, 1, of which 7 are even and 3 are odd. Hence a(12) = Floor(7/3) = 2.
		

Crossrefs

Cf. A078719.

Programs

  • Mathematica
    f[n_] := Module[{a, i, o}, i = n; o = 1; a = {}; While[i > 1, If[Mod[i, 2] == 1, o = o + 1]; a = Append[a, i]; i = f[i]]; o]; Table[f[i], {i, 1, 100}]

Extensions

Escape clause added to definition by N. J. A. Sloane, Jun 06 2017

A087227 Number of distinct prime factors of A087226(n), the LCM of terms in trajectory of 3x+1 (function) initiated at n.

Original entry on oeis.org

0, 1, 3, 1, 2, 3, 6, 1, 7, 2, 5, 3, 3, 6, 6, 1, 4, 7, 7, 2, 3, 5, 5, 3, 7, 3, 37, 6, 6, 6, 35, 1, 8, 4, 4, 7, 7, 7, 12, 2, 36, 3, 8, 5, 5, 5, 35, 3, 7, 7, 8, 3, 3, 37, 35, 6, 10, 6, 11, 6, 6, 35, 36, 1, 7, 8, 9, 4, 5, 4, 34, 7, 36, 7, 5, 7, 7, 12, 12, 2, 7, 36, 35, 3, 3, 8, 11, 5, 10, 5, 32, 5, 6, 35, 35
Offset: 1

Views

Author

Labos Elemer, Aug 28 2003

Keywords

Comments

This sequence differs from A078719: a(n) <= (number of odd terms in list).

Examples

			n=25: A087226(25) = 535792400 with factor-set={2,5,11,13,17,19,29} so a(25)=7, while number of odd terms in the trajectory is A078219(25)=8.
		

Crossrefs

Previous Showing 11-20 of 26 results. Next