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

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

A355239 Starting values k > 4 of a Collatz iteration reaching either k-1 or k+1.

Original entry on oeis.org

5, 6, 7, 9, 11, 14, 15, 17, 18, 19, 25, 33, 39, 41, 47, 51, 54, 57, 59, 62, 71, 81, 89, 91, 107, 108, 121, 159, 161, 166, 183, 243, 250, 252, 284, 333, 376, 378, 411, 432, 487, 501, 639, 649, 651, 667, 865, 889, 959, 975, 977, 1153, 1185, 1299, 1335, 1368, 1439, 1731, 1779, 1823, 2159, 2307, 2430, 2735, 3239, 3643, 4103, 4617, 4857, 4859, 6155, 7287, 7289, 9233
Offset: 1

Views

Author

Hugo Pfoertner, Jul 04 2022

Keywords

Comments

No further terms up to 2*10^9. It is conjectured that this is the full list of starting values of Collatz trajectories reaching k-1 or k+1, and that the number of steps until this happens is one of the 8 terms of A355240.
There are no further terms up to 31100000000. - Dmitry Kamenetsky, Oct 17 2022

Crossrefs

Programs

  • Python
    def f(x): return 3*x+1 if x%2 else x//2
    def ok(n):
        if n < 5: return False
        ni, targets = n, {1, n-1, n+1}
        while ni not in targets: ni = f(ni)
        return ni in {n-1, n+1}
    print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Jul 04 2022

A221213 Conjectured total number of times that k-n appears in the Collatz (3x+1) sequence of k for k = 1, 2, 3,....

Original entry on oeis.org

42, 42, 57, 52, 46, 53, 58, 57, 54, 49, 56, 59, 49, 62, 61, 59, 69, 59, 50, 54, 72, 64, 65, 55, 57, 54, 55, 66, 61, 60, 62, 61, 64, 73, 62, 59, 71, 63, 62, 58, 68, 72, 63, 59, 57, 65, 70, 59, 60, 59, 71, 55, 64, 54, 66, 75, 67, 62, 64, 64, 73, 68, 68, 67, 58, 61
Offset: 1

Views

Author

Jayanta Basu, Feb 21 2013

Keywords

Comments

Values are tested for natural numbers up to 1000000.

Examples

			a(1) = 42 = total number of k such that k-1 appears in the Collatz sequence of k, that is, the number of terms in A070991.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 75; t = Table[0, {nn}]; lastChange = 10; k = 0; While[k < 2*lastChange, k++; c = Collatz[k]; d = Intersection[Range[nn], k - c]; If[Length[d] > 0, lastChange = k; t[[d]]++]]; t (* T. D. Noe, Feb 21 2013 *)

A355568 Numbers k > 4 in a Collatz trajectory reaching k after starting at k-1.

Original entry on oeis.org

8, 10, 16, 20, 26, 34, 40, 52, 92, 122, 160, 167, 184, 244, 251, 334, 377, 412, 433, 488, 502, 650, 668, 866, 890, 976, 1154, 1186, 1300, 1336, 1732, 1780, 2308, 3644, 4858, 7288
Offset: 1

Views

Author

Hugo Pfoertner, Jul 10 2022

Keywords

Examples

			8 is a term because the orbit started at 8 - 1 = 7 reaches 8:
  7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8;
10 is a term because it is in the orbit starting at 10 - 1 = 9:
  9 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10.
		

Crossrefs

Programs

  • PARI
    collatz(start,target) = {my(old=start,new=0); while (new!=target && new!=1, if(old%2==0, new=old/2, new=3*old+1); old=new); new>1};
    for (k=5, 10000, if(collatz(k-1,k), print1(k,", ")))

Formula

a(n) = A070993(n+1) + 1.

A355569 Numbers k > 4 in a Collatz trajectory reaching k after starting at k+1.

Original entry on oeis.org

5, 8, 10, 13, 16, 17, 38, 40, 46, 53, 56, 58, 61, 70, 80, 88, 106, 107, 160, 251, 283, 377, 638, 650, 958, 976, 1367, 1438, 1822, 2158, 2429, 2734, 3238, 4102, 4616, 4858, 6154, 7288, 9232
Offset: 1

Views

Author

Hugo Pfoertner, Jul 10 2022

Keywords

Examples

			a(1) = 5 because the orbit started at 6 = a(1) + 1 reaches 5:
  6 -> 3 -> 10 -> 5;
a(2) = 8 because the orbit started at 9 = a(2) + 1 reaches 8:
  9 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8;
a(3) = 10 because the orbit started at 11 = a(3) + 1 reaches 10:
  11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10.
		

Crossrefs

Programs

  • PARI
    collatz(start, target) = {my(old=start, new=0); while (new!=target && new!=1, if(old%2==0, new=old/2, new=3*old+1); old=new); new>1};
    for (k=5, 10000, if(collatz(k+1, k), print1(k, ", ")))

Formula

a(n) = A070991(n+2) - 1.

A219696 Numbers k such that the trajectory of 3k + 1 under the '3x + 1' map reaches k.

Original entry on oeis.org

1, 2, 4, 8, 10, 14, 16, 20, 22, 26, 40, 44, 52, 106, 184, 206, 244, 274, 322, 526, 650, 668, 790, 866, 976, 1154, 1300, 1438, 1732, 1780, 1822, 2308, 2734, 3238, 7288
Offset: 1

Views

Author

Robert C. Lyons, Nov 25 2012

Keywords

Comments

This sequence seems complete; there are no other terms <= 10^9. - T. D. Noe, Dec 03 2012
If the 3x+1 step is replaced with (3x+1)/2, the sequence becomes {1, 2, 4, 8, 10, 14, 20, 22, 26, 40, 44, 206, 244, 650, 668, 866, 1154, 1822, 2308, ...}. - Robert G. Wilson v, Jan 13 2015
From Andrew Slattery, Aug 03 2023: (Start)
For most terms k, the trajectory of 3k + 1 reaches 310 or the trajectory of 310 reaches k.
For the rest of the terms k, the trajectory of 3k + 1 reaches 22 or the trajectory of 22 reaches k.
With the exception of k = 1, k is reached after S steps,
where S = c*8 + d*13 + e*44 + f*75, with c, d, e and f in {0, 1, 2}; in particular, S is in {8, 13, 8+8, 8+13, 13+13, 44, 75, 44+44, 75+13+13, 75+44, 75+75}. (End)

Examples

			For k = 4, the Collatz trajectory of 3k + 1 is (13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which includes 4; thus, 4 is in the sequence.
For k = 5, the Collatz trajectory of 3k + 1 is (16, 8, 4, 2, 1), which does not include 5; thus, 5 is not in the sequence.
		

Crossrefs

Programs

  • Haskell
    a219696 n = a219696_list !! (n-1)
    a219696_list = filter (\x -> collatz'' x == x) [1..] where
       collatz'' x = until (`elem` [1, x]) a006370 (3 * x + 1)
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Select[Range[10000], MemberQ[Collatz[3 # + 1], #] &] (* T. D. Noe, Dec 03 2012 *)
  • PARI
    a006370(n) = if(n%2==0, n/2, 3*n+1)
    is(n) = my(x=3*n+1); while(1, x=a006370(x); if(x==n, return(1), if(x==1, return(0)))) \\ Felix Fröhlich, Jun 10 2021
  • Python
    def ok(n):
        if n==1: return [1]
        N=3*n + 1
        l=[N, ]
        while True:
            if N%2==1: N = 3*N + 1
            else: N/=2
            l+=[N, ]
            if N<2: break
        if n in l: return 1
        return 0 # Indranil Ghosh, Apr 22 2017
    

Extensions

Initial 1 from Clark R. Lyons, Dec 02 2012
Showing 1-6 of 6 results.