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

A072268 a(0)=1; a(n+1) = 1 + f(a(n))^2, where f(x) is the largest prime factor of x (A006530).

Original entry on oeis.org

1, 2, 5, 26, 170, 290, 842, 177242, 160802, 2810, 78962, 9223370, 5033760602, 2935496262242, 2154284576409188208716642, 1379590379356276893461978662419832989306970202, 10320758390549056348725939119133160378521185060950774444682
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 08 2002

Keywords

Comments

Is the sequence bounded?
Essentially the same as A031439; a(n) = A031439(n-1)^2 + 1. - Charles R Greathouse IV, May 08 2009

Examples

			Given a(5)=290: a(6) = 1 + lpf(a(5))^2 = 1 + lpf(290)^2 = 1 + 29^2 = 842.
		

Crossrefs

Cf. A031439.

Programs

  • Maple
    with(numtheory): a[0]:=1: a[1]:=2: for n from 2 to 20 do b:=factorset(a[n-1]): a[n]:=1+op(nops(b),b)^2: od: seq(a[n],n=0..20); # Emeric Deutsch, Feb 05 2006
  • Mathematica
    NestList[1+FactorInteger[#][[-1,1]]^2&,1,17] (* Harvey P. Dale, Feb 01 2022 *)

Extensions

More terms from Emeric Deutsch, Feb 05 2006
a(16) corrected by T. D. Noe, Nov 26 2007

A379652 a(1) = 2. For n > 1, a(n) = smallest prime factor of c=2*a(n-1)+1 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is 2*c+1; and so on.

Original entry on oeis.org

2, 5, 11, 23, 47, 19, 3, 7, 31, 127, 17, 71, 13, 37, 151, 101, 29, 59, 239, 479, 137, 1103, 2207, 883, 2357, 41, 83, 167, 67, 271, 181, 727, 97, 1567, 6271, 113, 227, 911, 1823, 521, 149, 599, 109, 73, 197, 79, 53, 107, 43, 563, 347, 139, 373, 997, 307, 1231
Offset: 1

Views

Author

Robert C. Lyons, Dec 28 2024

Keywords

Comments

The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 17 primes.
- The first 10^3 terms include the first 131 primes.
- The first 10^4 terms include the first 808 primes.
- The first 10^5 terms include the first 4397 primes.
- The first 10^6 terms include the first 35801 primes.
- The first 10^7 terms include the first 253682 primes.
Conjecture: this sequence is a permutation of the primes.
If we start with 1 instead of 2 we get A379727. - N. J. A. Sloane, Dec 31 2024

Examples

			a(6) is 19 because the prime factors of c=2*a(5)+1 (i.e., 95) are 5 and 19, and 5 already appears in the sequence as a(2).
a(9) is 31 because the prime factors of c=2*a(8)+1 (i.e., 15) are 3 and 5 which already appear in the sequence as a(7) and a(2). The next value of c (i.e., 2*c+1) is 31, which is prime and does not already appear in the sequence.
		

Crossrefs

Programs

  • Mathematica
    c[_] := True; j = 2; c[2] = False;
    {j}~Join~Reap[Do[m = 2*j + 1;
      While[Set[k, SelectFirst[FactorInteger[m][[All, 1]], c] ];
        !IntegerQ[k],
        m = 2*m + 1];
      c[k] = False; j = Sow[k], {120}] ][[-1, 1]] (* Michael De Vlieger, Dec 29 2024 *)
  • Python
    from sympy import primefactors
    seq = [2]
    seq_set = set(seq)
    max_seq_len=100
    while len(seq) <= max_seq_len:
        c = seq[-1]
        done = False
        while not done:
            c = 2*c+1
            factors = primefactors(c)
            for factor in factors:
                if factor not in seq_set:
                    seq.append(factor)
                    seq_set.add(factor)
                    done = True
                    break
    print(seq)

A056650 a(n) is the greatest prime factor of a(n-1)^2+a(n-1)+1.

Original entry on oeis.org

2, 7, 19, 127, 5419, 1009, 9181, 1423, 96493, 163350799, 25249969, 212520319916977, 784949209969, 145542538757017, 147660435988297, 2508855873622663, 3565137918692593, 6521735641, 11273204227, 16141059763, 125679599753438821, 240780337980146570229319, 7282590063606707136764017
Offset: 0

Views

Author

Henry Bottomley, Aug 09 2000

Keywords

Comments

Except for the first term the initial (ten at least) terms are one more than a multiple of 6, with the result that a(n)^2+a(n)+1 is in these cases an odd multiple of 3 and appears to be 3 times the product of primes all of which are one more than a multiple of 6.

Crossrefs

Extensions

More terms from Vladeta Jovovic, Nov 26 2001

A125256 Smallest odd prime divisor of n^2 + 1.

Original entry on oeis.org

5, 5, 17, 13, 37, 5, 5, 41, 101, 61, 5, 5, 197, 113, 257, 5, 5, 181, 401, 13, 5, 5, 577, 313, 677, 5, 5, 421, 17, 13, 5, 5, 13, 613, 1297, 5, 5, 761, 1601, 29, 5, 5, 13, 1013, 29, 5, 5, 1201, 41, 1301, 5, 5, 2917, 17, 3137, 5, 5, 1741, 13, 1861, 5, 5, 17, 2113, 4357, 5, 5
Offset: 2

Views

Author

Nick Hobson, Nov 26 2006

Keywords

Comments

Any odd prime divisor of n^2+1 is congruent to 1 modulo 4.
n^2+1 is never a power of 2 for n > 1; hence a prime divisor congruent to 1 modulo 4 always exists.
a(n) = 5 if and only if n is congruent to 2 or -2 modulo 5.
If the map "x -> smallest odd prime divisor of n^2+1" is iterated, does it always terminate in the 2-cycle (5 <-> 13)? - Zoran Sunic, Oct 25 2017

Examples

			The prime divisors of 8^2 + 1 = 65 are 5 and 13, so a(7) = 5.
		

References

  • D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 191.

Crossrefs

Programs

  • Maple
    with(numtheory, factorset);
    A125256 := proc(n) local t1,t2;
    if n <= 1 then return(-1); fi;
    if (n mod 5) = 2 or (n mod 5) = 3 then return(5); fi;
    t1 := numtheory[factorset](n^2+1);
    t2:=sort(convert(t1,list));
    if (n mod 2) = 1 then return(t2[2]); fi;
    t2[1];
    end;
    [seq(A125256(n),n=1..40)]; # N. J. A. Sloane, Nov 04 2017
  • Mathematica
    Table[Select[First/@FactorInteger[n^2+1],OddQ][[1]],{n,2,68}] (* James C. McMahon, Dec 16 2024 *)
  • PARI
    vector(68, n, if(n<2, "-", factor(n^2+1)[1+(n%2),1]))
    
  • PARI
    A125256(n)=factor(n^2+1)[1+bittest(n,0),1] \\ M. F. Hasler, Nov 06 2017

A379899 a(1) = 2. For n > 1, a(n) = smallest prime factor of c=a(n-1)+4 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is c+4; and so on.

Original entry on oeis.org

2, 3, 7, 11, 5, 13, 17, 29, 37, 41, 53, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 127, 131, 139, 151, 163, 167, 179, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373
Offset: 1

Views

Author

Robert C. Lyons, Jan 05 2025

Keywords

Comments

The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 95 primes.
- The first 10^3 terms include the first 697 primes.
- The first 10^4 terms include the first 6783 primes.
- The first 10^5 terms include the first 98563 primes.
Conjecture: this sequence is a permutation of the primes.

Examples

			a(2) is 3 because the prime factors of c=a(1)+4 (i.e., 6) are 2 and 3, and 2 already appears in the sequence as a(1).
a(6) is 13 because the only prime factor of c=a(5)+4 (i.e., 9) is 3 which already appears in the sequence as a(2). The next value of c (i.e., c+4) is 13, which is prime and does not already appear in the sequence.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<1, {}, b(n-1) union {a(n)}) end:
    a:= proc(n) option remember; local c, p; p:= infinity;
          for c from a(n-1)+4 by 4 while p=infinity do
            p:= min(numtheory[factorset](c) minus b(n-1)) od; p
        end: a(1):=2:
    seq(a(n), n=1..200);  # Alois P. Heinz, Jan 11 2025
  • Mathematica
    nn = 120; c[_] := True; j = 2; s = 4; c[2] = False;
    Reap[Do[m = j + s;
      While[k = SelectFirst[FactorInteger[m][[All, 1]], c];
        ! IntegerQ[k], m += s];
    c[k] = False; j = Sow[k], {nn}] ][[-1, 1]] (* Michael De Vlieger, Jan 11 2025 *)
  • Python
    from sympy import primefactors
    seq = [2]
    seq_set = set(seq)
    max_seq_len=100
    while len(seq) <= max_seq_len:
        c = seq[-1]
        done = False
        while not done:
            c = c + 4
            factors = primefactors(c)
            for factor in factors:
                if factor not in seq_set:
                    seq.append(factor)
                    seq_set.add(factor)
                    done = True
                    break
    print(seq)

A379775 a(1) = 2. For n > 1, a(n) = smallest prime factor of c=2*a(n-1)-1 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is 2*c-1; and so on.

Original entry on oeis.org

2, 3, 5, 17, 11, 7, 13, 97, 193, 769, 29, 19, 37, 73, 577, 1153, 461, 307, 613, 31, 61, 241, 113, 449, 23, 89, 59, 233, 929, 619, 1237, 2473, 43, 337, 673, 269, 179, 211, 421, 41, 107, 71, 47, 67, 53, 139, 277, 79, 157, 313, 1249, 227, 151, 601, 1201, 4801
Offset: 1

Views

Author

Robert C. Lyons, Jan 02 2025

Keywords

Comments

The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 28 primes.
- The first 10^3 terms include the first 92 primes.
- The first 10^4 terms include the first 710 primes.
- The first 10^5 terms include the first 4848 primes.
- The first 10^6 terms include the first 29442 primes.
- The first 10^7 terms include the first 260324 primes.
Conjecture: this sequence is a permutation of the primes.

Examples

			a(6) is 7 because the prime factors of c=2*a(5)-1 (i.e., 21) are 3 and 7, and 3 already appears in the sequence as a(2).
a(8) is 97 because the only prime factor of c=2*a(7)-1 (i.e., 25) is 5 which already appears in the sequence as a(3). The next value of c (i.e., 2*c-1) is 49; its only prime factor is 7 which already appears in the sequence as a(6). The next value of c (i.e., 2*c-1) is 97, which is prime and does not already appear in the sequence.
		

Crossrefs

Programs

  • Python
    from sympy import primefactors
    seq = [2]
    seq_set = set(seq)
    max_seq_len=100
    while len(seq) <= max_seq_len:
        c = seq[-1]
        done = False
        while not done:
            c = 2*c-1
            factors = primefactors(c)
            for factor in factors:
                if factor not in seq_set:
                    seq.append(factor)
                    seq_set.add(factor)
                    done = True
                    break
    print(seq)

A166134 a(n+1) is the smallest divisor of a(n)^2+1 that does not yet appear in the sequence, with a(1) = 1.

Original entry on oeis.org

1, 2, 5, 13, 10, 101, 5101, 26, 677, 45833, 65, 2113, 446477, 130, 16901, 41, 29, 421, 17, 58, 673, 45293, 25, 313, 97, 941, 34057, 50, 61, 1861, 1229, 773, 59753, 89, 34, 1157, 82, 269, 194, 617, 38069, 55740337, 145, 10513, 11052317, 12215371106849
Offset: 1

Views

Author

Keywords

Comments

All members of the sequence can be represented as the sum of two relatively prime numbers (A008784). It appears that the sequence is infinite and that all such numbers are present.

Examples

			After a(4)=13, the divisors of 13^2+1=170 are 1,2, 5, 10, 17, 34, 85, 170. 1, 2, and 5 have already occurred, so a(5) = 10.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Min[Complement[Divisors[#[[-1]]^2 + 1], #]]] &, {1}, 45] (* Ivan Neretin, Sep 03 2015 *)
  • PARI
    invec(v,x,n)=for(i=1,n,if(v[i]==x,return(1)));0
    bl(n)={local(v,d,ds);
    v=vector(n,i,1);
    for(i=2,n,
    ds=divisors(v[i-1]^2+1);
    for(k=2,#ds,d=ds[k];if(!invec(v,d,i-1),v[i]=d;break)));
    v}

A083557 a(n) is the greatest prime factor of 3*a(n-1)+2.

Original entry on oeis.org

3, 11, 7, 23, 71, 43, 131, 79, 239, 719, 127, 383, 1151, 691, 83, 251, 151, 13, 41, 5, 17, 53, 23, 71, 43, 131, 79, 239, 719, 127, 383, 1151, 691, 83, 251, 151, 13, 41, 5, 17, 53, 23, 71, 43, 131, 79, 239, 719, 127, 383, 1151, 691, 83, 251, 151, 13, 41, 5, 17, 53, 23
Offset: 1

Views

Author

Yasutoshi Kohmoto, Jun 05 2003

Keywords

Comments

Conjecture: if a(1)=m then the sequence becomes cyclic, for any m.
Conjecture verified up to 25000000 by Jud McCranie, Jun 11 2003

Crossrefs

Programs

  • Mathematica
    f[n_] := Flatten[Table[ #[[1]], {1}] & /@ FactorInteger[ 3n + 2 ]][[ -1]]; NestWhileList[f, 3, UnsameQ, All]
    NestList[FactorInteger[3#+2][[-1,1]]&,3,70] (* Harvey P. Dale, Feb 21 2013 *)
  • PARI
    lista(nn) = {print1(a = 3, ", "); for (n=1, nn, a = vecmax(factor(3*a+2)[,1]); print1(a, ", "););} \\ Michel Marcus, Jul 15 2017

Formula

G.f.: x*(3 + 11*x + 7*x^2 + 23*x^3 + 71*x^4 + 43*x^5 + 131*x^6 + 79*x^7 + 239*x^8 + 719*x^9 + 127*x^10 + 383*x^11 + 1151*x^12 + 691*x^13 + 83*x^14 + 251*x^15 + 151*x^16 + 13*x^17 + 41*x^18 + 2*x^19 + 6*x^20 + 46*x^21) / (1 - x^19) (conjectured). - Colin Barker, Jul 15 2017

A279687 a(0) = 1, a(n) is the least prime factor of a(n-1)^2+1 that has not previously appeared in the sequence for n > 0.

Original entry on oeis.org

1, 2, 5, 13, 17, 29, 421, 401, 37, 1877, 41
Offset: 0

Views

Author

Keywords

Examples

			a(7) is a prime factor of a(6)^2+1 = 421^2 + 1 = 177242, which factors as 2*13*17*401. 2, 13, and 17 have already appeared in the sequence, so a(7) = 401.
a(10)^2+1 = 882 = 2 * 29^2. Both 2 and 29 have already appeared in the sequence, so it terminates.
		

Crossrefs

Cf. A031439.
Showing 1-9 of 9 results.