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 10 results.

A057689 Maximal term in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if no such term exists.

Original entry on oeis.org

16, 66, 50, 672, 20372, 494, 36918, 1404, 12210, 4248, 5070, 1682, 1850, 2210, 35882, 102720, 94484303672, 30084, 178992, 5330, 246560, 6890, 294253314, 8416400, 515202, 134004, 2810784, 2810883506682183650, 377198408, 320168
Offset: 2

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.

Examples

			For n=3, P=7: trajectory of 7 is 7, 50, 25, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, ..., which has maximal term 50, cycle length 4 and there are 4 terms before it enters the cycle.
		

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 11 2023 *)
  • Python
    from sympy import prime, primerange
    def a(n):
        P = prime(n)
        x, plst, seen = P, list(primerange(2, P)), set()
        while x > 1 and x not in seen:
            seen.add(x)
            x = next((x//p for p in plst if x%p == 0), P*x+1)
        return max(seen)
    print([a(n) for n in range(2, 32)]) # Michael S. Branicky, Dec 11 2023

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000

A057690 Length of cycle in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if trajectory does not cycle.

Original entry on oeis.org

3, 3, 4, 4, 3, 4, 4, 5, 4, 6, 3, 4, 4, 6, 5, 5, 3, 4, 6, 3, 6, 5, 5, 4, 4, 5, 6, 4, 4, 8, 5, 4, 5, 5, 5, 3, 4, 6, 4, 6, 4, 8, 3, 5, 6, 4, 7, 5, 4, 5, 7, 4, 6, 4, 6, 6, 6, 3, 12, 4, 5, 5, 6, 3, 4, 4, 4, 5, 5, 4, 7, 6, 4, 5, 9, 5, 3, 4, 4, 6, 3, 8, 4, 6, 5, 6, 3, 5, 6, 6, 8, 5, 5, 6, 7, 5, 5, 4, 3, 4, 5, 5, 5, 5, 4
Offset: 2

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.
Note that not all cycles for the iteration starting with p contain the number 1; a(60), for the prime 281, is the first example of this. Its iterates are: 281, 78962, 39481, 3037, 853398, 426699, 142233, 47411, 6773, 521, 146402, 73201, 1031, 289712, 144856, 72428, 36214, 18107, 953, 267794, 133897, with the last 12 terms cycling. Another example is provided by 2543, the 372nd prime. - T. D. Noe, Apr 02 2008

Examples

			For n=4, P=7: trajectory of 7 is 7, 50, 25, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, ..., which has maximal term 50, cycle length 4 and there are 4 terms before it enters the cycle.
		

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 11 2023 *)
  • PARI
    f(m, p) = {forprime(q=2, precprime(p-1), if (! (m % q), return (m/q));); m*p+1;}
    a(n) = {my(p=prime(n), x=p, list = List()); listput(list, x); while (1, x = f(x, p); for (i=1, #list, if (x == list[i], return (#list - i + 1));); listput(list, x););} \\ Michel Marcus, Jan 12 2021
    
  • Python
    from sympy import prime, primerange
    def a(n):
        P = prime(n)
        x, plst, traj, seen = P, list(primerange(2, P)), [], set()
        while x not in seen:
            traj.append(x)
            seen.add(x)
            x = next((x//p for p in plst if x%p == 0), P*x+1)
        return len(traj) - traj.index(x)
    print([a(n) for n in range(2, 107)]) # Michael S. Branicky, Dec 11 2023

Formula

a(n) = A023514(n)+1 if the cycle contains the number 1. - Jon Maiga, Jan 12 2021

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000
Corrected by T. D. Noe, Apr 02 2008

A057691 Number of terms before entering cycle in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if trajectory does not cycle.

Original entry on oeis.org

5, 13, 4, 10, 25, 11, 68, 14, 39, 34, 9, 4, 5, 5, 16, 16, 234, 23, 16, 5, 11, 5, 63, 116, 18, 18, 33, 288, 47, 29, 317, 14, 12, 61, 60, 6, 16, 10, 5, 14, 46, 5, 6, 15, 105, 4, 11, 48, 44, 5, 6, 10, 5, 55, 15, 14, 25, 17, 9, 16, 6, 7, 26, 5, 33, 46, 5, 16, 23, 13, 15, 11, 16, 14, 11
Offset: 2

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.

Examples

			For n=3, P=7: trajectory of 7 is 7, 50, 25, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, ..., which has maximal term 50, cycle length 4 and there are 4 terms before it enters the cycle.
		

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 11 2023 *)
  • Python
    from sympy import prime, primerange
    def a(n):
        P = prime(n)
        x, plst, traj, seen = P, list(primerange(2, P)), [], set()
        while x not in seen:
            traj.append(x)
            seen.add(x)
            x = next((x//p for p in plst if x%p == 0), P*x+1)
        return traj.index(x)
    print([a(n) for n in range(2, 82)]) # Michael S. Branicky, Dec 11 2023

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000

A057684 Trajectory of 13 under the '13x+1' map.

Original entry on oeis.org

13, 170, 85, 17, 222, 111, 37, 482, 241, 3134, 1567, 20372, 10186, 5093, 463, 6020, 3010, 1505, 301, 43, 560, 280, 140, 70, 35, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7, 1, 14, 7
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

The 'Px+1 map': if x is divisible by any prime < P then divide out these primes one at a time starting with the smallest; otherwise multiply x by P and add 1.

Crossrefs

Programs

  • Maple
    with(numtheory): a := proc(n,S,Q) option remember: local k; if n=0 then RETURN(S); fi: for k from 1 to Q do if a(n-1,S,Q) mod ithprime(k) = 0 then RETURN(a(n-1,S,Q)/ithprime(k)); fi: od: RETURN(ithprime(Q+1)*a(n-1,S,Q)+1) end; # run with S=13 and Q=5.
  • Mathematica
    a[n_, S_, Q_] := a[n, S, Q] = Module[{k}, If[n == 0, S, For[k = 1, k <= Q, k++, If[Mod[a[n-1, S, Q], Prime[k]] == 0, Return[a[n-1, S, Q]/Prime[k]]] ]; Prime[Q+1]*a[n-1, S, Q] + 1]];
    Table[a[n, 13, 5], {n, 0, 60}] (* Jean-François Alcover, Jul 13 2016, adapted from Maple *)

A057685 Trajectory of 19 under the `19x+1' map.

Original entry on oeis.org

19, 362, 181, 3440, 1720, 860, 430, 215, 43, 818, 409, 7772, 3886, 1943, 36918, 18459, 6153, 2051, 293, 5568, 2784, 1392, 696, 348, 174, 87, 29, 552, 276, 138, 69, 23, 438, 219, 73, 1388, 694, 347, 6594, 3297, 1099, 157, 2984, 1492, 746
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 10 2023 *)

A057686 Trajectory of 23 under the `23x+1' map.

Original entry on oeis.org

23, 530, 265, 53, 1220, 610, 305, 61, 1404, 702, 351, 117, 39, 13, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1, 24, 12, 6, 3, 1
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 10 2023 *)

A057687 Trajectory of 29 under the `29x+1' map.

Original entry on oeis.org

29, 842, 421, 12210, 6105, 2035, 407, 37, 1074, 537, 179, 5192, 2596, 1298, 649, 59, 1712, 856, 428, 214, 107, 3104, 1552, 776, 388, 194, 97, 2814, 1407, 469, 67, 1944, 972, 486, 243, 81, 27, 9, 3, 1, 30, 15, 5, 1, 30, 15, 5, 1, 30, 15
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 10 2023 *)

A232711 Conjectured list of numbers whose trajectory under the '5x+1' map eventually reaches 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 15, 16, 19, 24, 30, 32, 38, 48, 51, 60, 64, 65, 76, 96, 97, 102, 120, 128, 130, 137, 152, 155, 163, 175, 192, 194, 204, 219, 240, 243, 256, 260, 274, 304, 307, 310, 326, 343, 350, 384, 388, 397, 408, 417, 429, 438, 480, 486, 491, 512
Offset: 1

Views

Author

Jon Perry, Nov 28 2013

Keywords

Comments

This is conjectural in that there is no known proof that 7, 9, 11, etc. (see A267970) do not eventually cycle. - N. J. A. Sloane, Jan 23 2016
It appears that most numbers diverge, but nothing is known for certain.
Note that the computer programs do not actually calculate a complete list of "numbers k such that the Collatz-like map T: if x odd, x -> 5*x+1 and if x even, x -> x/2, when started at k, eventually reaches 1".

Examples

			Beginning with 15 we get the trajectory 15, 76, 38, 19, 96, 48, 24, 12, 6, 3, 16, 8, 4, 2, 1, so 15 is a term.
		

Crossrefs

See A267969, A267970 for other trajectories under this map T.
Cf. A070165 (usual Collatz iteration).

Programs

Extensions

Entry revised (corrected definition, added warnings to programs, deleted b-file) by N. J. A. Sloane, Jan 23 2016

A368085 Square array read by ascending antidiagonals: row n is the trajectory of P under the 'Px+1' map, where P = n-th prime.

Original entry on oeis.org

2, 3, 5, 5, 10, 11, 7, 26, 5, 23, 11, 50, 13, 16, 47, 13, 122, 25, 66, 8, 95, 17, 170, 61, 5, 33, 4, 191, 19, 290, 85, 672, 1, 11, 2, 383, 23, 362, 145, 17, 336, 8, 56, 1, 767, 29, 530, 181, 29, 222, 168, 4, 28, 4, 1535, 31, 842, 265, 3440, 494, 111, 84, 2, 14, 2, 3071
Offset: 1

Views

Author

Paolo Xausa, Dec 11 2023

Keywords

Comments

The 'Px+1 map' is defined as follows: if there exists p = smallest prime < P which divides x then x = x/p, otherwise x = P*x + 1.

Examples

			Array begins:
  [ 1]   2,   5,  11,    23,   47,   95, 191, 383,  767, ... = A153893
  [ 2]   3,  10,   5,    16,    8,    4,   2,   1,    4, ... = A033478
  [ 3]   5,  26,  13,    66,   33,   11,  56,  28,   14, ... = A057688
  [ 4]   7,  50,  25,     5,    1,    8,   4,   2,    1, ... = A368113
  [ 5]  11, 122,  61,   672,  336,  168,  84,  42,   21, ... = A368114
  [ 6]  13, 170,  85,    17,  222,  111,  37, 482,  241, ... = A057684
  [ 7]  17, 290, 145,    29,  494,  247,  19, 324,  162, ... = A368115
  [ 8]  19, 362, 181,  3440, 1720,  860, 430, 215,   43, ... = A057685
  [ 9]  23, 530, 265,    53, 1220,  610, 305,  61, 1404, ... = A057686
  [10]  29, 842, 421, 12210, 6105, 2035, 407,  37, 1074, ... = A057687
  ...    |    |    |
      A000040 | A066885 (from n = 2)
           A066872
		

Crossrefs

Columns 1-3: A000040, A066872, A066885 (from n = 2).
Main diagonal gives A368159.

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iA368085list[dmax_]:=With[{a=Reverse[Table[NestList[Px1[Prime[n],#]&,Prime[n],dmax-n],{n,dmax}]]},Array[Diagonal[a,#]&,dmax,1-dmax]];
    A368085list[15] (* Generates 15 antidiagonals *)

A259193 5x + 1 sequence beginning at 11.

Original entry on oeis.org

11, 56, 28, 14, 7, 36, 18, 9, 46, 23, 116, 58, 29, 146, 73, 366, 183, 916, 458, 229, 1146, 573, 2866, 1433, 7166, 3583, 17916, 8958, 4479, 22396, 11198, 5599, 27996, 13998, 6999, 34996, 17498, 8749, 43746, 21873, 109366, 54683, 273416, 136708, 68354, 34177, 170886, 85443
Offset: 0

Views

Author

Alonso del Arte, Jun 21 2015

Keywords

Examples

			11 is odd, so it's followed by 5 * 11 + 1 = 56.
56 is even, so it's followed by 56/2 = 28.
		

Crossrefs

Programs

  • Magma
    [n eq 1 select 11 else IsOdd(Self(n-1)) select 5*Self(n-1)+1 else Self(n-1) div 2: n in [1..80]]; // Vincenzo Librandi, Jul 04 2015
  • Mathematica
    NestList[If[EvenQ[#], #/2, 5# + 1] &, 5, 100]

Formula

a(0) = 11; a(n) = 5a(n - 1) + 1 if a(n - 1) is odd, a(n) = a(n - 1)/2 otherwise.
Showing 1-10 of 10 results.