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

A057534 a(n+1) = a(n)/2 if 2|a(n), a(n)/3 if 3|a(n), a(n)/5 if 5|a(n), a(n)/7 if 7|a(n), a(n)/11 if 11|a(n), a(n)/13 if 13|a(n), otherwise 17*a(n)+1.

Original entry on oeis.org

61, 1038, 519, 173, 2942, 1471, 25008, 12504, 6252, 3126, 1563, 521, 8858, 4429, 75294, 37647, 12549, 4183, 71112, 35556, 17778, 8889, 2963, 50372, 25186, 12593, 1799, 257, 4370, 2185, 437, 7430, 3715, 743, 12632, 6316, 3158, 1579, 26844, 13422
Offset: 0

Views

Author

Murad A. AlDamen (Divisibility(AT)yahoo.com), Oct 17 2000

Keywords

Comments

This is the '17x+1' map. 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.
Sequence has period 84. - Alois P. Heinz, Jan 19 2021

Crossrefs

Cf. A057446, A057216 (short version), A057522, A057614.

Programs

  • Maple
    with(numtheory): a := proc(n) option remember: local k; if n=0 then RETURN(61); fi: for k from 1 to 6 do if a(n-1) mod ithprime(k) = 0 then RETURN(a(n-1)/ithprime(k)); fi: od: RETURN(17*a(n-1)+1) end:
  • Mathematica
    a[n_] := a[n] = Which[n == 0, 61, n <= 84, Module[{k}, For[k = 1, k < PrimePi[17], k++, If[Mod[a[n - 1], Prime[k]] == 0, Return[a[n - 1]/Prime[k]]]]; Return[17*a[n - 1] + 1]], True, a[n - 84]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 22 2023, after Maple code *)
  • PARI
    a(n)=if(n, n=a(n-1); if(n%2, if(n%3, if(n%5, if(n%7, if(n%11, if(n%13, 17*n+1, n/13), n/11), n/7), n/5), n/3), n/2), 61) \\ Charles R Greathouse IV, Oct 13 2022

Extensions

More terms from James Sellers and Larry Reeves (larryr(AT)acm.org), Oct 18 2000

A057614 a(n+1) = a(n)/2 if 2|a(n), a(n)/3 if 3|a(n), a(n)/5 if 5|a(n), a(n)/7 if 7|a(n), otherwise 11*a(n)+1.

Original entry on oeis.org

17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51, 17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51, 17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51, 17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51, 17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51, 17, 188, 94, 47, 518, 259, 37, 408, 204, 102, 51
Offset: 0

Views

Author

Murad A. AlDamen (Divisibility(AT)yahoo.com), Oct 17 2000

Keywords

Comments

This is the '11x+1' map. 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.
Sequence has period 11. - Alois P. Heinz, Jan 19 2021

Crossrefs

Programs

  • Mathematica
    NestList[Which[Mod[#,2]==0,#/2,Mod[#,3]==0,#/3,Mod[#,5]==0,#/5,Mod[#,7]==0,#/7,True,11#+1]&,17,70] (* or *) PadRight[{},100,{17,188,94,47,518,259,37,408,204,102,51}] (* Harvey P. Dale, Jun 30 2025 *)

A057216 To get next term, multiply by 17, add 1 and discard any prime factors < 17.

Original entry on oeis.org

61, 173, 1471, 521, 4429, 4183, 2963, 257, 437, 743, 1579, 2237, 3803, 2309, 19627, 5561, 47269, 14881, 3833, 32581, 263, 43, 61, 173, 1471, 521, 4429, 4183, 2963, 257, 437, 743, 1579, 2237, 3803, 2309, 19627, 5561, 47269, 14881, 3833, 32581, 263, 43
Offset: 0

Views

Author

Murad A. AlDamen (Divisibility(AT)yahoo.com), Oct 17 2000

Keywords

Comments

This is the '17x+1' map. 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.
Sequence has period 22. - Alois P. Heinz, Jan 15 2021

Examples

			61 -> 17*61+1 = 1038 = 2*3*173 -> 173, so second term is 173.
		

Crossrefs

Cf. A057446, A057522, A057534 (long version), A057614.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n == 0, 61, n <= 22, Times @@ Power @@@ Select[ FactorInteger[17 a[n - 1] + 1], #[[1]] >= 17&], True, a[n - 22]];
    Table[a[n], {n, 0, 43}] (* Jean-François Alcover, Aug 21 2023 *)
  • PARI
    lista(nn) = {my(x=61); for (n=1, nn, print1(x, ", "); my(f=factor(17*x+1)); for (k=1, #f~, if (f[k,1] < 17, f[k,1] = 1)); x = factorback(f););} \\ Michel Marcus, Jan 19 2021

Extensions

More terms from James Sellers and Larry Reeves (larryr(AT)acm.org), Oct 18 2000

A057446 To get next term, multiply by 13, add 1 and discard any prime factors < 13.

Original entry on oeis.org

73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101, 73, 19, 31, 101
Offset: 0

Views

Author

Murad A. AlDamen (Divisibility(AT)yahoo.com), Oct 17 2000

Keywords

Comments

This is the '13x+1' map. 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.
Sequence has period 4. - Alois P. Heinz, Jan 19 2021

Examples

			73 -> 13*73+1 = 950 = 2*5^2*19 -> 19, so second term is 19.
		

Crossrefs

Cf. A057216, A057522 (long version), A057534, A057614.

Programs

  • Mathematica
    m13[n_]:=First[Times@@@Select[FactorInteger[13 n+1],#[[1]]>11&]]; NestList[ m13,73,80] (* or *) PadRight[{},80,{73,19,31,101}] (* Harvey P. Dale, Apr 16 2019 *)
    a[n_] := a[n] = Which[n == 0, 73, n <= 4, Times @@ Power @@@ Select[ FactorInteger[13 a[n - 1] + 1], #[[1]] >= 13&], True, a[n - 4]];
    Table[a[n], {n, 0, 59}] (* Jean-François Alcover, Aug 21 2023 *)

A057688 Trajectory of 5 under the '5x+1' map.

Original entry on oeis.org

5, 26, 13, 66, 33, 11, 56, 28, 14, 7, 36, 18, 9, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6, 3, 1, 6
Offset: 0

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

The 'Px + 1 map': if x is divisible by any prime less than P then divide out these primes one at a time starting with the smallest; otherwise multiply x by P and add 1. This is similar to A057684, but with P = 5 instead of P = 13. - Alonso del Arte, Jul 04 2015

Examples

			7 is odd and not divisible by 3, so it's followed by 5 * 7 + 1 = 36.
36 is even, so it's followed by 36/2 = 18.
18 is even, so it's followed by 18/2 = 9.
9 is odd and divisible by 3, so it's followed by 9/3 = 3.
		

Crossrefs

Programs

  • Mathematica
    NestList[If[EvenQ[#], #/2, If[Mod[#, 3] == 0, #/3, 5# + 1]] &, 5, 100] (* Alonso del Arte, Jul 04 2015 *)
  • PARI
    Vec((5 + 26*x + 13*x^2 + 61*x^3 + 7*x^4 - 2*x^5 - 10*x^6 - 5*x^7 + 3*x^8 - 49*x^9 + 8*x^10 + 4*x^11 + 2*x^12 - 33*x^13 - 17*x^14 - 3*x^15) / ((1 - x)*(1 + x + x^2)) + O(x^100)) \\ Colin Barker, Oct 10 2019

Formula

a(0) = 5, a(n) = a(n - 1)/2 if a(n - 1) is even, a(n) = a(n - 1)/3 if a(n - 1) is odd and divisible by 3, a(n) = 5a(n - 1) otherwise.
From Colin Barker, Oct 10 2019: (Start)
G.f.: (5 + 26*x + 13*x^2 + 61*x^3 + 7*x^4 - 2*x^5 - 10*x^6 - 5*x^7 + 3*x^8 - 49*x^9 + 8*x^10 + 4*x^11 + 2*x^12 - 33*x^13 - 17*x^14 - 3*x^15) / ((1 - x)*(1 + x + x^2)).
a(n) = a(n-3) for n>15.
(End)

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 *)
Showing 1-10 of 12 results. Next