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

A275531 Values taken by the sum of numbers in Collatz trajectory (A033493), sorted into ascending order.

Original entry on oeis.org

1, 3, 7, 15, 31, 36, 46, 49, 55, 63, 66, 67, 91, 106, 119, 127, 139, 145, 148, 186, 190, 197, 214, 235, 248, 255, 259, 274, 281, 288, 301, 302, 316, 325, 330, 339, 346, 357, 386, 393, 399, 413, 427, 442, 442, 452, 465, 497, 498, 500, 505, 509, 511, 519, 535, 540
Offset: 1

Views

Author

Jaroslav Krizek, Jul 31 2016

Keywords

Comments

Values a(n) such that a(n) = a(n+1): 442, 609, 633, 724, 904, 925, ...

Crossrefs

Programs

  • Magma
    Sort([&+[k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]: n in [1..2^10] | &+[k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]] le 2^10])

A275532 Possible values for sum of numbers in Collatz trajectory (A033493), sorted into ascending order.

Original entry on oeis.org

1, 3, 7, 15, 31, 36, 46, 49, 55, 63, 66, 67, 91, 106, 119, 127, 139, 145, 148, 186, 190, 197, 214, 235, 248, 255, 259, 274, 281, 288, 301, 302, 316, 325, 330, 339, 346, 357, 386, 393, 399, 413, 427, 442, 452, 465, 497, 498, 500, 505, 509, 511, 519, 535, 540, 557
Offset: 1

Views

Author

Jaroslav Krizek, Jul 31 2016

Keywords

Comments

Values a(n) such that a(n) = A033493(x) = A033493(y) for distinct numbers x and y: 442, 609, 633, 724, 904, 925, ...

Crossrefs

Programs

  • Magma
    Set(Sort([&+[k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]: n in [1..2^10] | &+[k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]] le 2^10]))
  • Mathematica
    Take[#, 56] &@ Union@ Table[Total@ FixedPointList[Which[# == 1, 1, OddQ@ #, 3 # + 1, True, #/2] &, n] - 1, {n, 10^3}] (* Michael De Vlieger, Aug 02 2016 *)

A247717 Numbers n such that A033493(n)/A008908(n) is an integer.

Original entry on oeis.org

1, 5, 18, 58, 99, 153, 176, 228, 238, 240, 282, 341, 345, 421, 475, 585, 629, 712, 739, 779, 802, 815, 974, 995, 1078, 1088, 1237, 1257, 1262, 1290, 1346, 1398, 1424, 1459, 1673, 1694, 1724, 1731, 1802, 1811, 1916, 1928, 1988, 2170, 2222, 2260, 2272, 2275, 2317, 2365, 2397, 2410
Offset: 1

Views

Author

Derek Orr, Sep 22 2014

Keywords

Comments

Equivalently, these are also numbers n such that the average of the numbers in the Collatz (3x+1) iteration of n is an integer.

Crossrefs

Programs

  • PARI
    Tavg(n)=c=0;s=n;while(n!=1,if(n==Mod(0,2),n=n/2;c++;s+=n);if(n==Mod(1,2)&&n!=1,n=3*n+1;s+=n;c++));s/(c+1)
    n=1;while(n<10^4,if(floor(Tavg(n))==Tavg(n),print1(n,", "));n++)

A254783 Numbers n such that A033493(n)/n is an integer.

Original entry on oeis.org

1, 57, 847, 1694, 3039, 3388, 3479, 6078, 6776, 6958, 13916, 27832, 55664, 111328, 236107, 246721, 311257, 493442, 622514, 986884, 1245028, 1328233, 1973768, 2052521, 2490056, 2656466, 3947536, 4105042, 4980112, 8210084
Offset: 1

Views

Author

Derek Orr, Feb 07 2015

Keywords

Comments

If A033493(n)/n = M is even, then 2*n is a member of the sequence and A033493(2*n)/(2*n) = M/2 + 1.
a(31) > 10^7. - Derek Orr, Mar 12 2015
Sum of reciprocals seems to converge quickly to 1.0208... - Derek Orr, Mar 12 2015

Crossrefs

Cf. A033493.

Programs

  • Mathematica
    a033493[n_] := Block[{f}, f[1] = 1; f[x_Integer?OddQ] := 3 x + 1; f[x_Integer?EvenQ] := x/2; -1 + Plus @@ FixedPointList[f, n]]; Select[Range[10^5], IntegerQ[a033493[#]/#] &] (* Michael De Vlieger, Feb 09 2015, after Alonso del Arte at A033493 *)
  • PARI
    Tsum(n)=s=n;while(n!=1,if(n==Mod(0,2),n=n/2;s+=n);if(n==Mod(1,2)&&n!=1,n=3*n+1;s+=n));s
    for(n=1,10^6,if(type(Tsum(n)/n)=="t_INT",print1(n,", ")))

A275114 Primes p for which the sum of the numbers in the Collatz iteration (A033493) of p is a prime.

Original entry on oeis.org

2, 67, 149, 163, 229, 359, 373, 401, 571, 719, 727, 827, 919, 941, 1031, 1049, 1129, 1153, 1201, 1283, 1307, 1319, 1433, 1453, 1627, 1637, 1987, 2017, 2089, 2137, 2237, 2267, 2281, 2351, 2543, 2617, 2731, 2819, 2851, 2861, 2927, 2969, 3191, 3253, 3581, 3671, 3719
Offset: 1

Views

Author

Jaroslav Krizek, Jul 17 2016

Keywords

Comments

Primes p such that A033493(p) is a prime.
Prime terms from A225748.

Examples

			Prime 67 with Collatz trajectory (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) is a term because A033493(67) = 1459 (prime).
		

Crossrefs

Programs

  • Magma
    [n: n in [1..4000] | IsPrime(&+[k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]) and IsPrime(n)];
  • Mathematica
    Select[Prime@ Range@ 540, PrimeQ[Total@ FixedPointList[Which[# == 1, 1, EvenQ@ #, #/2, True, 3 # + 1] &, #] - 1] &] (* Michael De Vlieger, Jul 17 2016, after Alonso del Arte at A033493 *)

A070165 Irregular triangle read by rows giving trajectory of n in Collatz problem.

Original entry on oeis.org

1, 2, 1, 3, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 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, 8, 4, 2, 1, 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 10, 5, 16, 8, 4, 2, 1, 11, 34, 17, 52, 26, 13
Offset: 1

Views

Author

Eric W. Weisstein, Apr 23 2002

Keywords

Comments

n-th row has A008908(n) entries (unless some n never reaches 1, in which case the triangle ends with an infinite row). [Escape clause added by N. J. A. Sloane, Jun 06 2017]
A216059(n) is the smallest number not occurring in n-th row; see also A216022.
Comment on the mp3 file from Gordon Charlton (the recording artist Beat Frequency). The piece uses the first 3242 terms (i.e. the first 100 hailstone sequences), with pitch modulus 36, duration modulus 2. Its musicality stems from the many repetitions and symmetries within the sequence, and in particular the infrequency of multiples of 3. This means that when the pitch modulus is a multiple of 12 the notes are predominantly in the symmetric octatonic scale, known to modern classical composers as the second of Messiaen's modes of limited transposition, and to jazz musicians as half-whole diminished. - N. J. A. Sloane, Jan 30 2019

Examples

			The irregular array a(n,k) starts:
n\k   0  1  2  3  4   5  6   7  8  9 10 11 12 13 14 15 16 17 18 19
1:    1
2:    2  1
3:    3 10  5 16  8   4  2   1
4:    4  2  1
5:    5 16  8  4  2   1
6:    6  3 10  5 16   8  4   2  1
7:    7 22 11 34 17  52 26  13 40 20 10  5 16  8  4  2  1
8:    8  4  2  1
9:    9 28 14  7 22  11 34  17 52 26 13 40 20 10  5 16  8  4  2  1
10:  10  5 16  8  4   2  1
11:  11 34 17 52 26  13 40  20 10  5 16  8  4  2  1
12:  12  6  3 10  5  16  8   4  2  1
13:  13 40 20 10  5  16  8   4  2  1
14:  14  7 22 11 34  17 52  26 13 40 20 10  5 16  8  4  2  1
15:  15 46 23 70 35 106 53 160 80 40 20 10  5 16  8  4  2  1
... Reformatted and extended by _Wolfdieter Lang_, Mar 20 2014
		

Crossrefs

Cf. A006370 (step), A008908 (row lengths), A033493 (row sums).
Cf. A220237 (sorted rows), A347270 (array), A192719.
Cf. A070168 (Terras triangle), A256598 (reduced triangle).
Cf. A254311, A257480 (and crossrefs therein).
Cf. A280408 (primes).

Programs

  • Haskell
    a070165 n k = a070165_tabf !! (n-1) !! (k-1)
    a070165_tabf = map a070165_row [1..]
    a070165_row n = (takeWhile (/= 1) $ iterate a006370 n) ++ [1]
    a070165_list = concat a070165_tabf
    -- Reinhard Zumkeller, Oct 07 2011
    
  • Maple
    T:= proc(n) option remember; `if`(n=1, 1,
          [n, T(`if`(n::even, n/2, 3*n+1))][])
        end:
    seq(T(n), n=1..15);  # Alois P. Heinz, Jan 29 2021
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Flatten[Table[Collatz[n], {n, 10}]] (* T. D. Noe, Dec 03 2012 *)
  • PARI
    row(n, lim=0)={if (n==1, return([1])); my(c=n, e=0, L=List(n)); if(lim==0, e=1; lim=n*10^6); for(i=1, lim, if(c%2==0, c=c/2, c=3*c+1); listput(L, c); if(e&&c==1, break)); return(Vec(L)); } \\ Anatoly E. Voevudko, Mar 26 2016; edited by Michel Marcus, Aug 10 2021
    
  • Python
    def a(n):
        if n==1: return [1]
        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 l
    for n in range(1, 101): print(a(n)) # Indranil Ghosh, Apr 14 2017

Formula

T(n,k) = T^{(k)}(n) with the k-th iterate of the Collatz map T with T(n) = 3*n+1 if n is odd and T(n) = n/2 if n is even, n >= 1. T^{(0)}(n) = n. k = 0, 1, ..., A008908(n) - 1. - Wolfdieter Lang, Mar 20 2014

Extensions

Name specified and row length A-number corrected by Wolfdieter Lang, Mar 20 2014

A213909 Sum of all even numbers in Collatz (3x+1) trajectory of n.

Original entry on oeis.org

0, 2, 40, 6, 30, 46, 234, 14, 276, 40, 212, 58, 100, 248, 562, 30, 178, 294, 424, 60, 126, 234, 516, 82, 538, 126, 81178, 276, 366, 592, 80910, 62, 688, 212, 446, 330, 444, 462, 1894, 100, 81096, 168, 1090, 278, 416, 562, 80816, 130, 666, 588, 926, 178, 340
Offset: 1

Views

Author

Jayanta Basu, Mar 05 2013

Keywords

Examples

			a(5)=30 since Collatz trajectory of 5 is 5,16,8,4,2,1.
		

Crossrefs

Cf. A033493.

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Total[Select[Collatz[n], EvenQ]], {n, 100}] (* T. D. Noe, Mar 05 2013 *)

A220237 Triangle read by rows: sorted terms of Collatz trajectories.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 03 2013

Keywords

Comments

n-th row = sorted list of {A070165(n,k): k = 1..A006577(n)};
T(n,1) = 1 if Collatz conjecture is true.

Examples

			The table begins:
.   1:  [1]
.   2:  [1,2]
.   3:  [1,2,3,4,5,8,10,16]
.   4:  [1,2,4]
.   5:  [1,2,4,5,8,16]
.   6:  [1,2,3,4,5,6,8,10,16]
.   7:  [1,2,4,5,7,8,10,11,13,16,17,20,22,26,34,40,52]
.   8:  [1,2,4,8]
.   9:  [1,2,4,5,7,8,9,10,11,13,14,16,17,20,22,26,28,34,40,52]
.  10:  [1,2,4,5,8,10,16]
.  11:  [1,2,4,5,8,10,11,13,16,17,20,26,34,40,52]
.  12:  [1,2,3,4,5,6,8,10,12,16] .
		

Crossrefs

Cf. A006577 (row lengths), A025586(right edge), A033493 (row sums).

Programs

  • Haskell
    import Data.List (sort)
    a220237 n k = a220237_tabf !! (n-1) !! (k-1)
    a220237_row n = a220237_tabf !! (n-1)
    a220237_tabf = map sort a070165_tabf
  • Maple
    T:= proc(n) option remember; `if`(n=1, 1,
          sort([n, T(`if`(n::even, n/2, 3*n+1))])[])
        end:
    seq(T(n), n=1..10);  # Alois P. Heinz, Oct 16 2021
  • Mathematica
    Flatten[Table[Sort[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]],{n,12}]] (* Harvey P. Dale, Jan 28 2013 *)

A213916 Sum of all odd numbers in Collatz (3x+1) trajectory of n.

Original entry on oeis.org

1, 1, 9, 1, 6, 9, 54, 1, 63, 6, 47, 9, 19, 54, 132, 1, 36, 63, 95, 6, 22, 47, 117, 9, 120, 19, 20262, 54, 76, 132, 20194, 1, 153, 36, 94, 63, 91, 95, 450, 6, 20235, 22, 248, 47, 81, 117, 20163, 9, 140, 120, 204, 19, 59, 20262, 20426, 54, 305, 76, 411, 132, 178
Offset: 1

Views

Author

Jayanta Basu, Mar 05 2013

Keywords

Examples

			a(5)=6 since Collatz trajectory of 5 is 5,16,8,4,2,1.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Total[Select[Collatz[n], OddQ]], {n, 100}] (* T. D. Noe, Mar 05 2013 *)

Formula

a(n) = A033493(n) - A213909(n).

A285098 Row sums of irregular triangle A070168.

Original entry on oeis.org

1, 3, 23, 7, 20, 29, 124, 15, 147, 30, 117, 41, 63, 138, 296, 31, 106, 165, 231, 50, 84, 139, 281, 65, 294, 89, 40616, 166, 212, 326, 40486, 63, 377, 140, 258, 201, 259, 269, 986, 90, 40589, 126, 588, 183, 253, 327, 40455, 113, 382, 344, 514, 141, 223, 40670, 41000, 222
Offset: 1

Views

Author

Indranil Ghosh, Apr 17 2017

Keywords

Comments

a(n) is the sum of numbers in trajectory of Terras-modified Collatz problem with first number n.

Examples

			The 5th row of irregular triangle A070168 is [5, 8, 4, 2, 1] whose sum is 20. a(5) = 5 + 8 + 4 + 2 + 1 = 20.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[n<2, 1, If[OddQ[n], (3n + 1)/2, n/2]]; Table[-1 + Plus @@ FixedPointList[a, n], {n, 100}]
  • Python
    def a(n):
        if n==1: return 1
        l=[n]
        while True:
            if n%2==0: n//=2
            else: n = (3*n + 1)//2
            l.append(n)
            if n<2: break
        return sum(l)
    print([a(n) for n in range(1, 101)])
Showing 1-10 of 21 results. Next