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.

Previous Showing 11-13 of 13 results.

A323605 Smallest prime divisor of A000058(n) = A007018(n) + 1 (Sylvester's sequence).

Original entry on oeis.org

2, 3, 7, 43, 13, 3263443, 547, 29881, 5295435634831, 181, 2287, 73
Offset: 0

Views

Author

Robert FERREOL, Jan 19 2019

Keywords

Comments

a(n) is also the smallest prime divisor of A007018(n+1) that is not a divisor of A007018(n).
The prime numbers a(n) are all distinct, which proves the infinitude of the prime numbers (Saidak's proof).
a(12) <= 2589377038614498251653. - Daniel Suteu, Jan 20 2019
a(12)..a(50) = [?, 52387, 13999, 17881, 128551, 635263, ?, ?, 352867, 387347773, ?, 74587, ?, ?, 27061, 164299, 20929, 1171, ?, 1679143, ?, ?, 120823, 2408563, 38218903, 333457, 30241, 4219, 1085443, 7603, 1861, ?, 23773, 51769, 1285540933, 429547, ?, 8323570543, ?], where ? denote unknown values > 10^10. - Max Alekseyev, Oct 11 2023

Crossrefs

Programs

  • Maple
    with(numtheory):
    u:=1: P:=NULL: to 9 do P:=P,sort([op(divisors(u+1))])[2]: u:=u*(u+1) od:
    P;
  • PARI
    f(n)=if(n<1, n>=0, f(n-1)+f(n-1)^2); \\ A007018
    a(n)=divisors(f(n)+1)[2]; \\ Michel Marcus, Jan 20 2019

Formula

a(n) = A007996(m), where m is the smallest index such that A180871(m) = n. - Max Alekseyev, Oct 11 2023

Extensions

a(10)-a(11) from Daniel Suteu, Jan 20 2019

A375543 Sylvester primes. Yet another proof of the infinity of primes.

Original entry on oeis.org

2, 3, 7, 43, 13, 139, 547, 607, 1033, 181, 1987, 73, 2287, 29881, 13999, 17881, 31051, 52387, 67003, 74203, 128551, 352867, 635263, 74587, 1286773, 2271427, 27061, 164299, 20929, 1171, 298483, 1679143, 3229081, 3263443, 120823, 447841, 2408563, 333457, 30241, 4219
Offset: 1

Views

Author

Peter Luschny, Sep 02 2024

Keywords

Comments

Sylvester's sequence can be defined recursively S(n) = S(n-1)*(S(n-1) + 1) for n >= 1 starting S(0) = 1. (A000058(n) = S(n) + 1.)
Since S(n) and S(n) + 1 have no common divisors, it follows that S(n) has at least one more prime factor than S(n-1), and thus by induction, S(n) has at least n distinct prime factors. This simple and constructive form of Euclid's proof of the infinity of primes was formulated by Filip Saidak (see links).
To generate the sequence, select the smallest unchosen prime factor from all prime factors of S(0), S(1), ..., S(n-1). We call the infinite sequence constructed this way the 'Sylvester primes'. The terms, when ordered by size, can be found in A007996; any prime not a Sylvester prime can be located in A096264.
As a procedure, the sequence can hardly be described more clearly than in the Maple program below. Compared to other variants (for example A126263), it has the advantage that the primes generated start relatively small.

Examples

			The generation of the sequence starts:
  n   selected       factors of S(i), i<n       a(n)
  [1] {}             {2}                     ->   2,
  [2] {2}            {2, 3}                  ->   3,
  [3] {2, 3}         {2, 3, 7}               ->   7,
  [4] {2, 3, 7}      {2, 3, 7, 43}           ->  43,
  [5] {2, 3, 7, 43}  {2, 3, 7, 13, 43, 139}  ->  13.
		

Crossrefs

Variants: A126263, A367020.

Programs

  • Maple
    fact := n -> NumberTheory:-PrimeFactors(n):
    SylvesterPrimes := proc(len) local p, d, w, n;
    p := 1; d := {}; w := {};
    for n from 1 to len do
       p := p*(p + 1);
       d := fact(p) minus w;
       w := w union {min(d)};
    od end:
    SylvesterPrimes(8);
    isSylvesterPrime := proc(p) local s, M;
    M := NULL: s := 2:
    while not member(s, [M]) do
       M := M, s;
       s := (s^2 + s) mod p;
       if s = 0 then return true fi;
    od: false end:
  • Mathematica
    Module[{nmax = 20, a = {}, p = 1, f}, Do[p *= p + 1; f = 2; While[MemberQ[a,f] || !Divisible[p, f], f = NextPrime[f]]; AppendTo[a, f], nmax]; a] (* Paolo Xausa, Sep 03 2024 *)
  • Python
    from sympy import sieve
    from itertools import count, islice
    def smallest_new_primefactor(n, pf):
        return next(pi for i in count(1) if (pi:=sieve[i]) not in pf and n%pi==0)
    def agen(): # generator of terms
        p, d, w, pf = 1, set(), set(), set()
        while True:
            p = p*(p + 1)
            m = smallest_new_primefactor(p, w)
            w |= {m}
            yield m
    print(list(islice(agen(), 20)))
    # Michael S. Branicky, Sep 02 2024 after Peter Luschny
    
  • SageMath
    # Returns the first 24 terms in less than 60 seconds.
    def SylvesterPrimes(len: int) -> list[int]:
        M: list[int] = []
        p = q = 1
        for n in range(1, len + 1):
            p = p * (p + 1)
            pq = p // q
            for s in Primes():
                if pq % s == 0 and not s in M:
                    M.append(s)
                    q = q * s
                    print(n, s)
                    break
        return M
    SylvesterPrimes(24)  # Peter Luschny, Sep 05 2024

Extensions

a(21)-a(31) from Michael S. Branicky, Sep 03 2024
a(32) from Paolo Xausa, Sep 04 2024
a(33)-a(36) from Peter Luschny, Sep 05 2024
a(37)-a(40) from Jinyuan Wang, Jul 25 2025

A256147 First repeated number in Sylvester's sequence modulo prime(n).

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 4, 2, 7, 3, 2, 6, 2, 1, 7, 7, 7, 17, 7, 3, 1, 43, 66, 2, 72, 51, 7, 50, 32, 3, 111, 85, 26, 1, 44, 31, 7, 7, 96, 157, 23, 1, 88, 3, 97, 7
Offset: 1

Views

Author

Alonso del Arte, Mar 16 2015

Keywords

Comments

Sylvester's sequence (A000058) is an infinite coprime sequence, a fact that may lead to the incorrect intuition that all primes occur as factors of its terms. It's quite easy to check that no multiple of 5 occurs, since Sylvester's sequence modulo 5 is 2, 3, 2, 3, 2, 3, ...
If a multiple of p occurs in Sylvester's sequence at position j, then A000058(k) == 1 (mod p) for all k > j.
But if no multiple of p occurs in Sylvester's sequence at all, then Sylvester's sequence is fully periodic modulo p or it enters a cycle at some point.

Examples

			a(4) = 1, because the fourth prime is 7 and Sylvester's sequence modulo 7 is 2, 3, 0, 1, 1, 1, ...
a(5) = 3, because the fifth prime is 11 and Sylvester's sequence modulo 11 is 2, 3, 7, 10, 3, 7, 10, 3, 7, 10, ... (3 is the first number repeated).
		

References

  • J. J. Sylvester, Postscript to Note on a Point in Vulgar Fractions. American Journal of Mathematics Vol. 3, No. 4 (Dec., 1880): 388 - 389.

Crossrefs

Previous Showing 11-13 of 13 results.