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 21-30 of 121 results. Next

A350279 Irregular triangle T(n,k) read by rows in which row n lists the iterates of the Farkas map (A349407) from 2*n - 1 to 1.

Original entry on oeis.org

1, 3, 1, 5, 3, 1, 7, 11, 17, 9, 3, 1, 9, 3, 1, 11, 17, 9, 3, 1, 13, 7, 11, 17, 9, 3, 1, 15, 5, 3, 1, 17, 9, 3, 1, 19, 29, 15, 5, 3, 1, 21, 7, 11, 17, 9, 3, 1, 23, 35, 53, 27, 9, 3, 1, 25, 13, 7, 11, 17, 9, 3, 1, 27, 9, 3, 1, 29, 15, 5, 3, 1
Offset: 1

Views

Author

Paolo Xausa, Dec 22 2021

Keywords

Examples

			Written as an irregular triangle, the sequence begins:
  n\k   1   2   3   4   5   6   7
  -------------------------------
   1:   1
   2:   3   1
   3:   5   3   1
   4:   7  11  17   9   3   1
   5:   9   3   1
   6:  11  17   9   3   1
   7:  13   7  11  17   9   3   1
   8:  15   5   3   1
   9:  17   9   3   1
  10:  19  29  15   5   3   1
  11:  21   7  11  17   9   3   1
  12:  23  35  53  27   9   3   1
		

Crossrefs

Cf. A349407, A375909 (# of iterations), A375910 (row sums), A375911 (row maxs).
Cf. A070165.

Programs

  • Mathematica
    FarkasStep[x_] := Which[Divisible[x, 3], x/3, Mod[x, 4] == 3, (3*x + 1)/2, True, (x + 1)/2];
    Array[Most[FixedPointList[FarkasStep, 2*# - 1]] &, 15] (* Paolo Xausa, Sep 03 2024 *)

Formula

T(n,1) = 2*n-1; T(n,k) = A349407((T(n,k-1)+1)/2), where n >= 1 and k >= 2.

A070991 Numbers n such that the trajectory of n under the `3x+1' map reaches n - 1.

Original entry on oeis.org

2, 3, 5, 6, 9, 11, 14, 17, 18, 39, 41, 47, 54, 57, 59, 62, 71, 81, 89, 107, 108, 161, 252, 284, 378, 639, 651, 959, 977, 1368, 1439, 1823, 2159, 2430, 2735, 3239, 4103, 4617, 4859, 6155, 7289, 9233
Offset: 1

Views

Author

Benoit Cloitre and Boris Gourevitch (boris(AT)pi314.net), May 18 2002

Keywords

Comments

From Collatz conjecture, the trajectory of n never reaches n again. Is this sequence finite?
There are no more terms < 10^9. - Donovan Johnson, Sep 22 2013

Examples

			Trajectory of 39 is: (118, 59, 178, 89, 268, 134, 67, 202, 101, 304, 152, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1) and 39-1 = 38 is reached, hence 39 is in the sequence.
		

Crossrefs

Cf. A070165 (Collatz trajectories), A219696, A221213, A070993.

Programs

  • Haskell
    a070991 n = a070991_list !! (n-1)
    a070991_list = filter (\x -> (x - 1) `elem` a070165_row x) [1..]
    -- Reinhard Zumkeller, Feb 22 2013
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Select[Range[100000], MemberQ[Collatz[#], # - 1] &] (* T. D. Noe, Feb 21 2013 *)
  • PARI
    for(n=1,10000,s=n; t=0; while(s!=1,t++; if(s%2==0,s=s/2,s=3*s+1); if(s==n-1,print1(n,","); ); ))
    

A070993 Numbers n such that the trajectory of n under the "3x+1" map reaches n+1.

Original entry on oeis.org

3, 7, 9, 15, 19, 25, 33, 39, 51, 91, 121, 159, 166, 183, 243, 250, 333, 376, 411, 432, 487, 501, 649, 667, 865, 889, 975, 1153, 1185, 1299, 1335, 1731, 1779, 2307, 3643, 4857, 7287
Offset: 1

Views

Author

Benoit Cloitre and Boris Gourevitch (boris(AT)pi314.net), May 18 2002

Keywords

Comments

From Collatz conjecture, the trajectory of n never reaches n again. Is this sequence finite? (it seems there are no further terms below 10^6).
There are no more terms < 10^9. - Donovan Johnson, Sep 22 2013

Examples

			Trajectory of 39 is (118, 59, 178, 89, 268, 134, 67, 202, 101, 304, 152, 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 39+1=40, so 39 is in the sequence.
		

Crossrefs

Cf. A070165 (Collatz trajectories), A221213, A222293, A070991.

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Select[Range[100000], MemberQ[Collatz[#], # + 1] &] (* T. D. Noe, Feb 22 2013 *)
  • PARI
    for(n=1,10000,s=n; t=0; while(s!=1,t++; if(s%2==0,s=s/2,s=3*s+1); if(s==n-1,print1(n,","); ); ))

Extensions

Corrected by T. D. Noe, Oct 25 2006

A087226 LCM of terms in Collatz (3x+1) function initiated at n.

Original entry on oeis.org

1, 2, 240, 4, 80, 240, 1361360, 8, 12252240, 80, 194480, 240, 1040, 1361360, 4095840, 16, 17680, 12252240, 107158480, 80, 1344, 194480, 1365280, 240, 535792400, 1040, 44841486948146266934850832405421294927083491752830032389039800908293040266400
Offset: 1

Views

Author

Labos Elemer, Aug 28 2003

Keywords

Examples

			n=9: list={9,28,14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1};
LCM = 2*2*2*2*3*3*5*7*11*13*17 = 12252240.
		

Crossrefs

Programs

  • Haskell
    a087226 = foldl1 lcm . a070165_row  -- Reinhard Zumkeller, May 16 2013
  • 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[Apply[LCM, fpl[w]], {w, 1, 32}]
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[LCM @@ Collatz[n], {n, 27}] (* T. D. Noe, May 15 2013 *)

A192719 Chain of Collatz sequences.

Original entry on oeis.org

1, 2, 1, 3, 10, 5, 16, 8, 4, 2, 1, 6, 3, 10, 5, 16, 8, 4, 2, 1, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 12, 6, 3, 10, 5, 16, 8, 4, 2, 1
Offset: 1

Views

Author

Robert C. Lyons, Dec 31 2012

Keywords

Comments

The sequence is a chain of Collatz sequences. The first Collatz sequence in the chain is (1). Each of the subsequent Collatz sequences in the chain starts with the minimum positive integer that does not appear in the previous Collatz sequences. If the Collatz conjecture is true, then each Collatz sequence in the chain will end with 1, and the chain will include an infinite number of distinct Collatz sequences. If the Collatz conjecture is false, then the chain will end with the first Collatz sequence that does not converge to 1.
T(n,1) = A177729(n). - Reinhard Zumkeller, Jan 03 2013

Examples

			The first Collatz sequence in the chain is (1). The second Collatz sequence in the chain is (2, 1), which starts with 2, since 2 is the smallest positive integer that doesn't appear the first Collatz sequence. The third Collatz sequence in the chain is (3, 10, 5, 16, 8, 4, 2, 1), which starts with 3, since 3 is the smallest positive integer that doesn't appear the previous Collatz sequences.
Thus this irregular array starts:
1;
2,  1;
3, 10,  5, 16,  8,  4,  2,  1;
6,  3, 10,  5, 16,  8,  4,  2,  1;
7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10,  5, 16,  8, 4,  2, 1;
9, 28, 14,  7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1;
...
		

Crossrefs

Programs

  • Haskell
    a192719 n k = a192719_tabf !! (n-1) !! (k-1)
    a192719_row n = a192719_tabf !! (n-1)
    a192719_tabf = f [1..] where
       f (x:xs) = (a070165_row x) : f (del xs $ a220237_row x)
       del us [] = us
       del us'@(u:us) vs'@(v:vs) | u > v     = del us' vs
                                 | u < v     = u : del us vs'
                                 | otherwise = del us vs
    -- Reinhard Zumkeller, Jan 03 2013
  • Java
    See Lyons link.
    

A222118 Number of terms in Collatz (3x+1) trajectory of n that did not appear in previous trajectories.

Original entry on oeis.org

1, 1, 6, 0, 0, 1, 10, 0, 3, 0, 0, 1, 0, 0, 9, 0, 0, 1, 5, 0, 3, 0, 0, 1, 3, 0, 95, 0, 0, 1, 0, 0, 3, 0, 0, 1, 3, 0, 12, 0, 0, 1, 8, 0, 3, 0, 0, 1, 0, 0, 5, 0, 0, 1, 7, 0, 3, 0, 0, 1, 0, 0, 13, 0, 0, 1, 0, 0, 3, 0, 0, 1, 3, 0, 8, 0, 0, 1, 9, 0, 1, 0, 0, 1, 0, 0, 7
Offset: 1

Views

Author

Jayanta Basu, Feb 23 2013

Keywords

Comments

For n > 2, n such that a(n) = 0 are termed impure (A134191), while n such that a(n) > 0 are termed pure (A061641). - T. D. Noe, Feb 23 2013
From Robert G. Wilson v, Feb 25 2017: (Start)
For a(n) to be equal to 0, n != 0 (mod 3),
For a(n) to be an even positive number, n = {3, 7} (mod 12),
For a(n) to be equal to 1, n = {0, 1, 2, 3, 6, 7, 9} (mod 12),
For a(n) to be equal to 3, n = {1, 3, 9} (mod 12),
For a(n) to be an odd number > 3, n = {3, 7} (mod 12).
[Note that the above conditions are necessary but not sufficient. - Editors, Dec 15 2017]
(End)
a(n) gives the number of new terms in the n-th row of A070165 (see A263716). - Andrey Zabolotskiy, Feb 27 2017

Examples

			a(7) = 10, since trajectory of 7 includes 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, which did not appear in earlier trajectories.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; found = {}; Table[c = Collatz[n]; r = Complement[c, found]; found = Union[found, c]; Length[r], {n, 100}] (* T. D. Noe, Feb 23 2013 *)
  • Python
    s = set([1])
    print(1)
    for n in range(2, 100):
        m, r = n, 0
        while m not in s:
            s.add(m)
            m = (m//2 if m%2==0 else 3*m+1)
            r += 1
        print(r)
    # Andrey Zabolotskiy, Feb 21 2017

Formula

a(n) = A006577(n) - A221956(n) + 1. - Michel Lagneau, Feb 23 2013

A232711 Conjectured list of numbers whose trajectory under the '5x+1' map eventually reaches 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 15, 16, 19, 24, 30, 32, 38, 48, 51, 60, 64, 65, 76, 96, 97, 102, 120, 128, 130, 137, 152, 155, 163, 175, 192, 194, 204, 219, 240, 243, 256, 260, 274, 304, 307, 310, 326, 343, 350, 384, 388, 397, 408, 417, 429, 438, 480, 486, 491, 512
Offset: 1

Views

Author

Jon Perry, Nov 28 2013

Keywords

Comments

This is conjectural in that there is no known proof that 7, 9, 11, etc. (see A267970) do not eventually cycle. - N. J. A. Sloane, Jan 23 2016
It appears that most numbers diverge, but nothing is known for certain.
Note that the computer programs do not actually calculate a complete list of "numbers k such that the Collatz-like map T: if x odd, x -> 5*x+1 and if x even, x -> x/2, when started at k, eventually reaches 1".

Examples

			Beginning with 15 we get the trajectory 15, 76, 38, 19, 96, 48, 24, 12, 6, 3, 16, 8, 4, 2, 1, so 15 is a term.
		

Crossrefs

See A267969, A267970 for other trajectories under this map T.
Cf. A070165 (usual Collatz iteration).

Programs

Extensions

Entry revised (corrected definition, added warnings to programs, deleted b-file) by N. J. A. Sloane, Jan 23 2016

A076228 Number of terms k in the trajectory of the Collatz function applied to n such that k < n.

Original entry on oeis.org

0, 1, 2, 2, 3, 5, 4, 3, 6, 5, 6, 8, 6, 9, 6, 4, 8, 13, 10, 7, 5, 11, 8, 10, 13, 9, 9, 15, 13, 10, 9, 5, 16, 11, 8, 19, 17, 16, 17, 8, 12, 7, 19, 15, 13, 11, 12, 11, 19, 20, 17, 11, 9, 17, 14, 19, 23, 18, 21, 15, 13, 16, 14, 6, 22, 24, 21, 14, 12, 11, 15, 22, 18, 21, 7, 21, 19, 25, 22, 9
Offset: 1

Views

Author

Labos Elemer, Oct 01 2002

Keywords

Comments

It is believed that for each x, a(n) = x occurs a finite number of times and the largest n is 2^x.
Original name: Start iteration of Collatz-function (A006370) with initial value of n. a(n) shows how many times during fixed-point-list, the value sinks below initial one until reaching endpoint = 1. - Michael De Vlieger, Dec 13 2018

Examples

			A070165(18) = {18, 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}. a(18) = 13 because 13 terms are smaller than n = 18; namely: {9, 14, 7, 11, 17, 13, 10, 5, 16, 8, 4, 2, 1}.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := (1-Mod[x, 2])*(x/2)+(Mod[x, 2])*(3*x+1) f[1]=1; f0[x_] := Delete[FixedPointList[f, x], -1] f1[x_] := f0[x]-Part[f0[x], 1] f2[x_] := Count[Sign[f1[x]], -1] Table[f2[w], {w, 1, 256}]
    (* Second program: *)
    Table[Count[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # > 1 &], ?(# < n &)], {n, 80}] (* _Michael De Vlieger, Dec 09 2018 *)

A216022 Largest number m such that the Collatz trajectory starting at n contains all numbers not greater than m.

Original entry on oeis.org

1, 2, 5, 2, 2, 6, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2012

Keywords

Comments

a(n) <= 6; a(A007283(n)) = 6;
a(n) > 1 for n > 1; a(n) <> 3; a(n) <> 4; a(n) <> 5 for n > 3;
a(n) = A216059(n) - 1.
In the first 100000 terms, there are only 16 terms greater than 2, all of which but one are equal to 6. - Harvey P. Dale, Nov 29 2019

Examples

			n = 3->10->5->16->8->4->2->1 => {1_2_3_4_5 8 10 16}, a(3) = 5;
n = 4->2->1 => {1_2 4}, a(4) = 2;
n = 5->16->8->4->2->1 => {1_2 4 5 8 16}, a(5) = 2;
n = 6->3->10->5->16->8->4->2->1 => {1_2_3_4_5_6 8 10 16}, a(6) = 6.
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a216022 = length .
       takeWhile (== 0) . zipWith (-) [1..] . sort . a070165_row
  • Mathematica
    scoll[n_]:=Sort[NestWhileList[If[EvenQ[#],#/2,3#+1] &,n,#>1 &]]; Join[{1,2},Table[i=1; While[scoll[n][[i]]==i,i++]; i-1,{n,3,86}]] (* Jayanta Basu, May 27 2013 *)
    Join[{1,2},Flatten[Table[Position[Differences[Sort[ NestWhileList[ If[ EvenQ[#],#/2,3#+1]&,n,#>1&]]], ?(#>1&),1,1],{n,90}]]] (* _Harvey P. Dale, Nov 29 2019 *)

A216059 Smallest number not in Collatz trajectory starting at n.

Original entry on oeis.org

2, 3, 6, 3, 3, 7, 3, 3, 3, 3, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2012

Keywords

Comments

a(n) <= 7; a(A007283(n)) = 7;
a(n) <> 4; a(n) <> 4; a(n) <> 6 for n > 3;
a(n) = A216022(n) + 1.

Crossrefs

Programs

  • Haskell
    import Data.List ((\\))
    a216059  n = head $ enumFromTo 1 (maximum ts + 1) \\ ts
       where ts = a070165_row n
  • Mathematica
    scoll[n_]:=Sort[NestWhileList[If[EvenQ[#],#/2,3#+1] &,n,#>1 &]]; Join[{2,3},Table[i=1; While[scoll[n][[i]]==i,i++]; i,{n,3,86}]] (* Jayanta Basu, May 27 2013 *)
Previous Showing 21-30 of 121 results. Next