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

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

A257480 S(n) = (3 + (3/2)^v(1 + F(4*n - 3))*(1 + F(4*n - 3)))/6, n >= 1, where F(x) = (3*x + 1)/2^v(3*x + 1) for x odd, and v(y) denotes the 2-adic valuation of y.

Original entry on oeis.org

1, 1, 5, 2, 4, 1, 8, 5, 7, 5, 41, 5, 10, 2, 17, 14, 13, 4, 32, 8, 16, 1, 26, 14, 19, 8, 68, 11, 22, 5, 35, 41, 25, 7, 59, 14, 28, 5, 44, 23, 31, 41, 365, 17, 34, 5, 53, 41, 37, 10, 86, 20, 40, 2, 62, 32, 43, 17, 149
Offset: 1

Views

Author

L. Edson Jeffery, Apr 26 2015

Keywords

Comments

In the following, let F^(k)(x) denote k-fold iteration of F and defined by the recurrence F^(k)(x) = F(F^(k-1)(x)), k > 0, with initial condition F^(0)(x) = x, and let S^(k)(n) denote k-fold iteration of S and defined by the recurrence S^(k)(n) = S(S^(k-1)(n)), k > 0, with initial condition S^(0)(n) = n, where F and S are as defined above.
Theorem 1: For each x, there exists a j>0 such that F^(j)(x) == 1 (mod 4).
Theorem 2: S(n) = m if and only if S(4*n-2) = m.
Conjecture 1: For each n, there exists a k such that S^(k)(n) = 1.
Theorem 3: Conjecture 1 is equivalent to the 3x+1 conjecture.
Theorem 4: The sequence {log(S(n))/log(n)}_{n>1} is bounded with least upper bound equal to log(3)/log(2).
[I have proved Theorems 1--4 (along with several lemmas) and am trying to finish typesetting the draft containing the proofs but had been too ill to finish that work until now. The draft also contains the derivation of the function S from properties of the known function F (A075677). When that paper is completed (hopefully within two weeks) I will then upload it to the links section and delete this comment.]

References

  • K. H. Metzger, Untersuchungen zum (3n+1)-Algorithmus, Teil II: Die Konstruktion des Zahlenbaums, PM (Praxis der Mathematik in der Schule) 42, 2000, 27-32.

Crossrefs

Cf. A241957, A254067, A254311, A257499, A257791 (all used in the proof of Thm 4).
Cf. A253676 (iteration of S terminating at the first occurrence of 1, assuming the 3x+1 conjecture).

Programs

  • Mathematica
    v[x_] := IntegerExponent[x, 2]; f[x_] := (3*x + 1)/2^v[3*x + 1]; s[n_] := (3 + (3/2)^v[1 + f[4*n - 3]]*(1 + f[4*n - 3]))/6; Table[s[n], {n, 59}]
  • PARI
    a(n) = my(x=3*n-2, v=valuation(x, 2)); x>>=v; v=valuation(x+1, 2); (((x>>v)+1)*3^(v-1)+1)/2; \\ Ruud H.G. van Tol, Jul 30 2023

A254312 Rectangular array A read by upward antidiagonals in which the entry in row n and column k is defined by A(n,k) = (2^a(n)*(6*k - (3 - (-1)^a(n))*(1 - (-1)^n)/2) - 2^n + 4)/6, n,k >= 1, where {a(n)} is the Beatty sequence A117630 defined by a(n) = floor(n*log(3)/log(3/2)).

Original entry on oeis.org

3, 32, 7, 170, 64, 11, 1022, 426, 96, 15, 2726, 2046, 682, 128, 19, 65526, 10918, 3070, 938, 160, 23, 174742, 131062, 19110, 4094, 1194, 192, 27, 2097110, 436886, 196598, 27302, 5118, 1450, 224, 31, 11184726, 4194262, 699030, 262134, 35494, 6142, 1706, 256, 35
Offset: 1

Views

Author

L. Edson Jeffery, May 03 2015

Keywords

Comments

Conjecture: The array A contains without duplication all natural numbers m such that m < S(m), where the function S is as defined in A257480; i.e., the sequence is a permutation of A254311.

Examples

			Array A begins:
.         3       7      11      15       19       23       27       31
.        32      64      96     128      160      192      224      256
.       170     426     682     938     1194     1450     1706     1962
.      1022    2046    3070    4094     5118     6142     7166     8190
.      2726   10918   19110   27302    35494    43686    51878    60070
.     65526  131062  196598  262134   327670   393206   458742   524278
.    174742  436886  699030  961174  1223318  1485462  1747606  2009750
.   2097110 4194262 6291414 8388566 10485718 12582870 14680022 16777174
		

Crossrefs

Cf. A004767, A174312 (rows 1 and 2).

Programs

  • Mathematica
    (* Array antidiagonals flattened: *)
    a[n_] := Floor[n*Log[3/2, 3]]; A254312[n_, k_] := (2^a[n]*(6*k - (3 - (-1)^a[n])*(1 - (-1)^n)/2) - 2^n + 4)/6; Flatten[Table[A254312[n - k + 1, k], {n, 9}, {k, n}]]
Showing 1-3 of 3 results.