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.

A280409 Primes in the order that they appear in A280408, without repetitions.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 13, 23, 53, 19, 29, 41, 31, 47, 71, 107, 137, 103, 233, 263, 593, 167, 251, 283, 479, 719, 1619, 911, 1367, 577, 433, 61, 37, 59, 89, 67, 101, 43, 83, 73, 113, 79, 179, 269, 131, 197, 97, 149, 109, 173, 139, 157, 127, 191, 431, 647, 971
Offset: 1

Views

Author

Matthew Campbell, Jan 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    DeleteDuplicates@ Flatten@ Table[Select[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # > 1 &], PrimeQ], {n, 200}] (* Michael De Vlieger, Jan 02 2017 *)

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

A319227 a(n) is the number of twin primes in the Collatz trajectory of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 0, 2, 0, 1, 1, 0, 2, 0, 0, 0, 2, 2, 0, 0, 1, 0, 1, 2, 0, 0, 2, 1, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 1, 0, 0, 0, 1, 2, 2, 1, 0, 0, 0, 0, 2, 2, 1, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 2, 1, 2, 0, 2, 1, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2
Offset: 1

Views

Author

Michel Lagneau, Sep 14 2018

Keywords

Comments

Conjecture: a(n) <=2.
For a(n) = 2, the corresponding twin primes are (5, 7) and (11, 13) or (11, 13) and (17, 19).
This sequence is generalizable: let a(n, p, p+2q) be the number of pairs of primes of form (p, p+2q) in the Collatz trajectory of n, q = 1, 2,... It is conjectured that a(n, p, p+2q) < =2. (see the table below).
+----------------+---------------------------------+
| pairs of prime | pairs of prime numbers |
| numbers | in the Collatz trajectory |
| | when a(n, p, p+2q) = 2 |
+----------------+---------------------------------+
| (p, p+2) | (5, 7) and (11, 13) |
| | or (11, 13) and (17, 19) |
+----------------+---------------------------------+
| (p, p+4) | (7, 11) and (13, 17) |
+----------------+---------------------------------+
| (p, p+6) | (41, 47) and (47, 53) |
| | or (47, 53) and (97, 103) |
| | or (47, 53) and (587, 593) |
+----------------+---------------------------------+
| (p, p+8) | (23, 31) and (53, 61) |
+----------------+---------------------------------+
| (p, p+10) | (61, 71) and (73, 83) |
| | or (61, 71) and (283, 293) |
| | or (61, 71) and (577, 587) |
+----------------+---------------------------------+
| (p, p+12) | (71, 83) and (251, 263) |
| | or (251, 263) and (467, 479) |
| | or (251, 263) and (479, 491) |
| | or (251, 263) and (1607, 1619) |
+----------------+---------------------------------+
| (p, p+14) | No results for n <= 10^6 |
+----------------+---------------------------------+
...................................................

Examples

			a(7) = 2 because the Collatz trajectory of 7 is 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with two twin primes: (5, 7) and (11, 13).
		

Crossrefs

Programs

  • Maple
    nn:=10^8:
    for n from 1 to 100 do:
       m:=n:lst:={}:
          for i from 1 to nn while(m<>1) do:
            if irem(m, 2)=0
             then
             m:=m/2:
             else
             lst:=lst union {m}:m:=3*m+1:
           fi:
         od:
         n0:=nops(lst):it:=0:
         for j from 1 to n0-1 do:
         if isprime(lst[j]) and isprime(lst[j+1]) and lst[j+1]=lst[j]+2
         then it:=it+1:else fi:
          od:
        printf(`%d, `,it):
        od:
Showing 1-3 of 3 results.