A375543 Sylvester primes. Yet another proof of the infinity of primes.
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
Keywords
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.
Links
- Jens Kruse Andersen, Factorization of Sylvester's sequence.
- Chris Caldwell, Filip Saidak's Proof, PrimePages.
- Filip Saidak, A New Proof of Euclid's Theorem, Amer. Math. Monthly, Vol. 113, No. 10 (Dec., 2006), pp. 937-938.
Crossrefs
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
Comments