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

A062052 Numbers with exactly 2 odd integers in their Collatz (or 3x+1) trajectory.

Original entry on oeis.org

5, 10, 20, 21, 40, 42, 80, 84, 85, 160, 168, 170, 320, 336, 340, 341, 640, 672, 680, 682, 1280, 1344, 1360, 1364, 1365, 2560, 2688, 2720, 2728, 2730, 5120, 5376, 5440, 5456, 5460, 5461, 10240, 10752, 10880, 10912, 10920, 10922, 20480, 21504, 21760, 21824
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.
The sequence consists of terms of A002450 and their 2^k multiples. The first odd integer in the trajectory is one of the terms of A002450 and the second odd one is the terminal 1. - Antti Karttunen, Feb 21 2006
This sequence looks to appear first in the literature on page 1285 in R. E. Crandall.

Examples

			The Collatz trajectory of 5 is (5,16,8,4,2,1), which contains 2 odd integers.
		

Crossrefs

Is this a subset of A115774?
Column k=2 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062052 n = a062052_list !! (n-1)
    a062052_list = map (+ 1) $ elemIndices 2 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[22000], countOdd[Collatz[#]] == 2 &] (* T. D. Noe, Dec 03 2012 *)
  • PARI
    for(n=2,100000,s=n; t=0; while(s!=1,if(s%2==0,s=s/2,s=3*s+1; t++); if(s*t==1,print1(n,","); ); ))
    
  • 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.append(n)
                if n<2: break
            else: break
        return len([i for i in l if i % 2])
    print([n for n in range(1, 22001) if a(n)==2]) # Indranil Ghosh, Apr 14 2017

Formula

A078719(a(n)) = 2; A006667(a(n)) = 1.
a(n) = 2^x * (4^y - 1)/3 where x = A122196(n) - 1 and y = A122197(n) + 1. - Alan Michael Gómez Calderón, Jan 16 2025 after Antti Karttunen

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

Original entry on oeis.org

43, 86, 87, 89, 172, 173, 174, 177, 178, 179, 344, 346, 348, 349, 354, 355, 356, 357, 358, 385, 423, 688, 692, 693, 696, 698, 705, 708, 709, 710, 712, 714, 716, 717, 729, 761, 769, 770, 771, 777, 846, 847, 1376, 1384, 1386, 1392, 1393, 1396, 1397, 1410, 1411, 1415
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)) = 10; A006667(a(n)) = 9.

Examples

			The Collatz trajectory of 43 is (43, 130, 65, 196, 98, 49, 148, 74, 37, 112, 56, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 10 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=10 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062060 n = a062060_list !! (n-1)
    a062060_list = map (+ 1) $ elemIndices 10 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[#]] == 10 &] (* 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.append(n)
                if n<2: break
            else: break
        return len([1 for i in l if i%2])
    print([n for n in range(40, 1501) if a(n)==10]) # Indranil Ghosh, Apr 14 2017

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

Original entry on oeis.org

3, 6, 12, 13, 24, 26, 48, 52, 53, 96, 104, 106, 113, 192, 208, 212, 213, 226, 227, 384, 416, 424, 426, 452, 453, 454, 768, 832, 848, 852, 853, 904, 906, 908, 909, 1536, 1664, 1696, 1704, 1706, 1808, 1812, 1813, 1816, 1818, 3072, 3328, 3392, 3408, 3412, 3413, 3616
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 (A006370).
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
A078719(a(n)) = 3; A006667(a(n)) = 2.

Examples

			The Collatz trajectory of 3 is (3,10,5,16,8,4,2,1), which contains 3 odd integers.
		

References

  • J. R. Goodwin, Results on the Collatz Conjecture, Sci. Ann. Comput. Sci. 13 (2003) pp. 1-16
  • J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.

Crossrefs

Cf. A198584 (this sequence without the even numbers).
See also A198587.
Column k=3 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062053 n = a062053_list !! (n-1)
    a062053_list = map (+ 1) $ elemIndices 3 a078719_list
    -- Reinhard Zumkeller, Oct 08 2011
  • Mathematica
    Collatz[n_?OddQ] := (3n + 1)/2; Collatz[n_?EvenQ] := n/2; oddIntCollatzCount[n_] := Length[Select[NestWhileList[Collatz, n, # != 1 &], OddQ]]; Select[Range[4000], oddIntCollatzCount[#] == 3 &] (* Alonso del Arte, Oct 28 2011 *)

Formula

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

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

Original entry on oeis.org

11, 22, 23, 44, 45, 46, 88, 90, 92, 93, 176, 180, 181, 184, 186, 201, 352, 360, 362, 368, 369, 372, 373, 401, 402, 403, 704, 720, 724, 725, 736, 738, 739, 744, 746, 753, 802, 803, 804, 805, 806, 1408, 1440, 1448, 1450, 1472, 1476, 1477, 1478, 1488, 1492, 1493, 1506
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)) = 5; A006667(a(n)) = 4.

Examples

			The Collatz trajectory of 11 is (11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 5 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=5 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062055 n = a062055_list !! (n-1)
    a062055_list = map (+ 1) $ elemIndices 5 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[2000], countOdd[Collatz[#]] == 5 &] (* T. D. Noe, Dec 03 2012 *)

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

Original entry on oeis.org

7, 14, 15, 28, 29, 30, 56, 58, 60, 61, 112, 116, 117, 120, 122, 224, 232, 234, 240, 241, 244, 245, 267, 448, 464, 468, 469, 480, 482, 483, 488, 490, 497, 534, 535, 537, 896, 928, 936, 938, 960, 964, 965, 966, 976, 980, 981, 985, 994, 995, 1068, 1069, 1070, 1073
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)) = 6; A006667(a(n)) = 5.

Examples

			The Collatz trajectory of 7 is (7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 6 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=6 of A354236.

Programs

  • Haskell
    import Data.List (elemIndices)
    a062056 n = a062056_list !! (n-1)
    a062056_list = map (+ 1) $ elemIndices 6 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[#]] == 6 &] (* T. D. Noe, Dec 03 2012 *)

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

A092893 Smallest starting value in a Collatz '3x+1' sequence such that the sequence contains exactly n tripling steps.

Original entry on oeis.org

1, 5, 3, 17, 11, 7, 9, 25, 33, 43, 57, 39, 105, 135, 185, 123, 169, 219, 159, 379, 283, 377, 251, 167, 111, 297, 395, 263, 175, 233, 155, 103, 137, 91, 121, 161, 107, 71, 47, 31, 41, 27, 73, 97, 129, 171, 231, 313, 411, 543, 731, 487, 327, 859, 1145, 763, 1017, 1351
Offset: 0

Views

Author

Hugo Pfoertner, Mar 11 2004

Keywords

Comments

First occurrence of n in A006667.
These are the odd (primitive) terms in A129304. - T. D. Noe, Apr 09 2007
Except for a(1) = 5, all values are congruent {1, 3, 7} (mod 8). Reason: If n is 5 (mod 8) then the Collatz trajectory starting with m = (n - 1)/4 contains the same number of tripling steps, because n = 4m + 1 and the Collatz 3x + 1 step results in 3*(4m + 1) + 1 = 12m + 4 which gets reduced by halving to 3m + 1, without changing the number of tripling steps. - Ralf Stephan, Jun 19 2025

Examples

			a(4)=11 because the Collatz sequence 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 is the first sequence containing 4 tripling steps.
		

Crossrefs

Row n=1 of A354236.

Programs

  • Mathematica
    a[n_]:=Length[Select[NestWhileList[If[EvenQ[#],#/2,3#+1] &,n,#>1 &],OddQ]]; Table[i=1; While[a[i]!=n,i=i+2]; i,{n,58}] (* Jayanta Basu, May 27 2013 *)

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