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

A187831 Smallest number m > n such that n occurs in Collatz trajectory starting with m; a(0) = 1 by convention.

Original entry on oeis.org

1, 2, 3, 6, 5, 6, 12, 9, 9, 18, 11, 14, 24, 14, 18, 30, 17, 18, 36, 25, 22, 42, 25, 27, 48, 33, 28, 54, 36, 33, 60, 41, 42, 66, 36, 41, 72, 43, 39, 78, 41, 54, 84, 57, 50, 90, 47, 54, 96, 57, 66, 102, 56, 54, 108, 73, 57, 114, 59, 78, 120, 62, 82, 126, 75
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 04 2013

Keywords

Comments

A070165(a(n),k) = n for some k with 1 <= k <= A006577(a(n)).

Examples

			n = 10: row 11 of A070165 = [11,34,17,52,26,13,40,20,10,5,16,8,4,2,1],
therefore A070165(11,9) = 10 and a(10) = 11;
n = 11: rows 12 and 13 of A070165 don't contain 11, but 14 does:
row 12: [12,6,3,10,5,16,8,4,2,1],
row 13: [13,40,20,10,5,16,8,4,2,1],
row 14: [14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1],
therefore A070165(14,4) = 11: a(11) = 14.
		

Crossrefs

Programs

  • Haskell
    import Data.List (find)
    import Data.Maybe (fromJust)
    a187831 0 = 1
    a187831 n = head $ fromJust $
            find (n `elem`) $ drop (fromIntegral n) a070165_tabf
  • Mathematica
    mcollQ[n_,k_]:=MemberQ[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&],k]==True; Prepend[Table[i=n+1; While[!mcollQ[i,n],i++]; i,{n,64}],1] (* Jayanta Basu, May 27 2013 *)
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Join[{1}, Table[k = n + 1; While[! MemberQ[Collatz[k], n], k++]; k, {n, 100}]] (* T. D. Noe, May 28 2013 *)

A127929 a(n) = A127928(n) mod 18.

Original entry on oeis.org

3, 7, 1, 1, 7, 1, 7, 7, 1, 1, 7, 1, 1, 1, 7, 7, 1, 7, 1, 7, 7, 7, 7, 1, 1, 7, 7, 7, 1, 1, 1, 7, 7, 1, 7, 1, 7, 7, 7, 7, 1, 1, 1, 7, 1, 7, 1, 7, 1, 7, 7, 7, 7, 1, 7, 1, 7, 7, 7, 1, 1, 7, 7, 1, 7, 7, 1, 7, 1, 1, 7, 1, 7, 1, 1, 7, 1, 7, 1, 7, 1, 7, 7, 7, 7, 7, 1
Offset: 1

Views

Author

Gary W. Adamson, Feb 07 2007

Keywords

Comments

Aside from "3", all terms of A127928 must be 1 or 7 mod 18 (see A127928 for mod rules); but not all primes mod 1 or 7 are pure hailstone numbers. For example, the prime 61 == 7 mod 18 but 61 is impure. Conjecture: for large n, the numbers of 1 and 7 mod 18 terms are approximately equal.

Examples

			a(5) = 7 since A127928(5) = 43 and 43 == 7 mod 18.
		

Crossrefs

Formula

Pure hailstone (Collatz) numbers that are also prime (i.e. the set A127928), mod 18.

Extensions

More terms from Amiram Eldar, Feb 28 2020

A134191 Impure numbers in the Collatz (3x+1) iteration.

Original entry on oeis.org

2, 4, 5, 8, 10, 11, 13, 14, 16, 17, 20, 22, 23, 26, 28, 29, 31, 32, 34, 35, 38, 40, 41, 44, 46, 47, 49, 50, 52, 53, 56, 58, 59, 61, 62, 64, 65, 67, 68, 70, 71, 74, 76, 77, 80, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 98, 100, 101, 103, 104, 106, 107, 110, 112, 113, 116, 118
Offset: 1

Views

Author

T. D. Noe, Oct 12 2007

Keywords

Comments

Let f(k) be the trajectory of the Collatz iteration of the number k. Then Shaw calls a number n impure if n is in f(k) for some k < n. Shaw has an algorithm for finding congruences that the impure numbers satisfy.

Examples

			The Collatz trajectory of 3 is (3,10,5,16,8,4,2,1), showing that the numbers 4,5,8,10,16 are impure.
		

Programs

  • Mathematica
    c[n_] := If[EvenQ[n], n/2, 3n + 1]; nn=1000; t=Table[0,{nn}]; Do[If[t[[n]]==0, m=n; While[m=c[m]; If[nn>=m>n && t[[m]]==0, t[[m]]=n]; m>nn || t[[m]]>0]], {n,nn}]; Flatten[Position[t,_?(#>0&)]]

Formula

Complement of A061641.

A187108 Odd numbers not in the trajectory of a smaller number under the Collatz (3x+1) iteration.

Original entry on oeis.org

1, 3, 7, 9, 15, 19, 21, 25, 27, 33, 37, 39, 43, 45, 51, 55, 57, 63, 69, 73, 75, 79, 81, 87, 93, 97, 99, 105, 109, 111, 115, 117, 123, 127, 129, 133, 135, 141, 145, 147, 151, 153, 159, 163, 165, 169, 171, 177, 181, 183, 187, 189, 195, 199, 201, 207, 213, 217
Offset: 1

Views

Author

Jimin Park, Mar 05 2011

Keywords

Comments

These are the odd numbers in A061641, which gives a more detailed explanation. - T. D. Noe, Mar 05 2011

Crossrefs

Cf. A061641.

Programs

  • ActionScript
    // AS3
    var a:Array=new Array();
    var i:int;
    var n:int=0;
    var ni:int;
    var s:String='';
    for (i=0;i<50;i++){
    while(a[n]!=undefined) n++;
    s+=String(2*n+1)+',';
    a[n]=1;
    ni=2*n+1;
    while(ni>=2*n+1&&ni>1){
    ni=3*ni+1;
    while(ni%2==0)ni/=2;
    a[(ni-1)/2]=1;
    }
    }
    trace(s);

A235452 Take the union of all the sequences Collatz(i) for i <= n. The number a(n) is the largest of consecutive numbers beginning with 1.

Original entry on oeis.org

1, 2, 5, 5, 5, 6, 8, 8, 11, 11, 11, 14, 14, 14, 17, 17, 17, 18, 20, 20, 23, 23, 23, 24, 26, 26, 29, 29, 29, 32, 32, 32, 35, 35, 35, 36, 38, 38, 41, 41, 41, 42, 44, 44, 47, 47, 47, 50, 50, 50, 53, 53, 53, 54, 56, 56, 59, 59, 59, 62, 62, 62, 65, 65, 65
Offset: 1

Views

Author

Martin Y. Champel, Jan 10 2014

Keywords

Comments

The Collatz sequence is also called the 3x+1 sequence.

Examples

			Let the C(n) function compute the Collatz sequence starting at n.
For n = 1, C(1) = {1} then term 1 is 1.
For n = 2, C(2) = {1,2} then term 2 is 2.
For n = 3, C(3) = {3,10,5,16,8,4,2,1} = {1,2,3,4,5,8,10,16} then it contains {1,2,3,4,5} but not {1,2,3,4,5,6} then term 3 is 5.
For n = 4, C(4) = C(3) then term 4 is 5.
For n = 5, C(5) = C(4) = C(3) then term 5 is 5.
For n = 6, C(6) = {1,2,3,4,5,6,8,10,16} then term 6 is 6.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countConsec[lst_] := Module[{cnt = 0, i = 1}, While[i <= Length[lst] && lst[[i]] == i, cnt++; i++]; cnt]; mx = 0; u = {}; Table[c = Collatz[n]; u = Union[u, c]; mx = Max[mx, countConsec[u]], {n, 65}] (* T. D. Noe, Feb 23 2014 *)
  • Python
    def A235452(n=100):
        a = set([])
        A235452 = {1: 1}
        for i in range(2, n):
            c = i
            a.add(c)
            while c != 1:
                if c % 2 == 1:
                    c = 3 * c + 1
                    a.add(c)
                c = c / 2
                a.add(c)
            k = 1
            while k in a:
                k += 1
            A235452[i] = k - 1
        return A235452
    seq_map = A235452()
    for n in range(1, len(seq_map) + 1):
        print(seq_map[n], end=", ")

A336256 The cardinalities of the sets A(n), where A(0) is the empty set and A(n+1) is the union of A(n) and the Collatz orbit of the smallest natural number missing in A(n).

Original entry on oeis.org

0, 1, 4, 9, 10, 20, 23, 24, 33, 34, 39, 42, 43, 46, 141, 142, 145, 146, 149, 161, 162, 170, 173, 174, 179, 180, 187, 190, 191, 204, 205, 208, 209, 212, 220, 221, 230, 231, 232, 239, 240, 243, 244, 247, 252, 253, 256, 257, 260, 261, 262, 267, 270, 271, 284, 285
Offset: 0

Views

Author

Markus Sigg, Aug 08 2020

Keywords

Crossrefs

Programs

  • PARI
    firstMiss(A) = { my(i); if(#A == 0 || A[1] > 0, return(0)); for(i = 1, A[#A] + 1, if(!setsearch(A,i), return(i))); };
    iter(A) = { my(a = firstMiss(A)); while(!setsearch(A,a), A = setunion(A, Set([a])); a = if(a % 2, 3*a+1, a/2)); A; };
    makeVec(m) = { my(v = [], A = Set([]), i); for(i = 1, m, v = concat(v, #A); if (i < m, A = iter(A))); v; };
    makeVec(56)

A336992 The number of gaps in the sets A(n), where A(0) is the empty set and A(n+1) is the union of A(n) and the Collatz orbit of the smallest natural number missing in A(n).

Original entry on oeis.org

0, 0, 1, 3, 3, 9, 9, 8, 12, 12, 14, 15, 15, 16, 100, 99, 100, 100, 101, 108, 108, 112, 111, 110, 110, 110, 110, 111, 110, 116, 115, 115, 115, 116, 120, 120, 124, 123, 122, 122, 121, 122, 122, 123, 125, 124, 125, 125, 126, 125, 125, 127, 127, 126, 133, 133
Offset: 0

Views

Author

Markus Sigg, Aug 10 2020

Keywords

Comments

The number of gaps would be relevant for sparse representations of the sets A(n), which may be of use for a numerical verification of the Collatz conjecture up to a given number.

Crossrefs

Programs

  • PARI
    firstMiss(A) = { my(i); if(#A == 0 || A[1] > 0, return(0)); for(i = 1, A[#A] + 1, if(!setsearch(A, i), return(i))); };
    iter(A) = { my(a = firstMiss(A)); while(!setsearch(A, a), A = setunion(A, Set([a])); a = if(a % 2, 3*a+1, a/2)); A; };
    nGaps(A) = { my(i,c=0); for (i=2, #A, if (A[i-1] < A[i]-1, c = c+1;)); c; };
    makeVec(m) = { my(v = [], A = Set([]), i); for(i = 1, m, v = concat(v, nGaps(A)); if (i < m, A = iter(A))); v; };
    makeVec(57)

A375852 Numbers congruent to {0, 1, 3, 6, 7, 9, 12, 15} mod 18.

Original entry on oeis.org

0, 1, 3, 6, 7, 9, 12, 15, 18, 19, 21, 24, 25, 27, 30, 33, 36, 37, 39, 42, 43, 45, 48, 51, 54, 55, 57, 60, 61, 63, 66, 69, 72, 73, 75, 78, 79, 81, 84, 87, 90, 91, 93, 96, 97, 99, 102, 105, 108, 109, 111, 114, 115, 117, 120, 123, 126, 127, 129, 132, 133, 135, 138, 141, 144, 145, 147, 150
Offset: 1

Views

Author

Jules Beauchamp, Aug 31 2024

Keywords

Comments

Appears to be the union of A061641 (pure numbers in the Collatz (3x+1) iteration, also called pure hailstone numbers) and A309180 (unsuspected numbers to check in the Collatz conjecture).
The differences are periodic: 1, 2, 3, 1, 2, 3, 3, 3.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 200], MemberQ[{0, 1, 3, 6, 7, 9, 12, 15}, Mod[#, 18]] &] (* Amiram Eldar, Aug 31 2024 *)

Formula

From Stefano Spezia, Sep 03 2024: (Start)
G.f.: x^2*(1 + x + 2*x^2 - x^3 + 3*x^4 + 3*x^6)/((1 - x)^2*(1 + x^2 + x^4 + x^6)).
E.g.f.: ((9*x - 14)*cosh(x) + sin(x) + 2*sqrt(2)*cosh(x/sqrt(2))*sin(x/sqrt(2)) + (9*x - 14)*sinh(x) + 2*(6 + cos(x) + (sqrt(2)*cos(x/sqrt(2)) + sin(x/sqrt(2)))*sinh(x/sqrt(2))))/4. (End)
Previous Showing 11-18 of 18 results.