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

A359940 Lexicographically earliest sequence of distinct primes whose partial products lie between noncomposite numbers.

Original entry on oeis.org

2, 3, 5, 19, 11, 7, 31, 23, 193, 67, 367, 131, 317, 1097, 241, 1777, 773, 2819, 2689, 1381, 1741, 3389, 631, 8581, 41, 1553, 2297, 1427, 17053, 1493, 883, 619, 9803, 13331, 26203, 37, 7681, 41269, 1913, 27091, 3079, 31583, 5867, 22409, 13367, 37337, 29573, 6469
Offset: 1

Views

Author

Amiram Eldar, Jan 19 2023

Keywords

Examples

			2 - 1 = 1 and 2 + 1 = 3 are both noncomposite numbers.
2*3 - 1 = 5 and 2*3 + 1 = 7 are both noncomposite numbers.
2*3*5 - 1 = 29 and 2*3*5 + 1 = 31 are both noncomposite numbers.
		

Crossrefs

Programs

  • Maple
    P:= {seq(ithprime(i),i=2..10^5)}:
    R:= 2: s:= 2:
    for i from 2 to 100 do
      found:= false;
      for p in P do
        if isprime(p*s-1) and isprime(p*s+1) then R:= R,p; s:= p*s; P:= P minus {p}; found:= true; break fi;
      od;
      if not found then break fi
    od:
    R; # Robert Israel, Jan 19 2023
  • Mathematica
    a[1] = 2; a[n_] := a[n] = Module[{t = Table[a[k], {k, 1, n - 1}], p = 2, r}, r = Times @@ t; While[MemberQ[t, p] || ! PrimeQ[r*p - 1] || ! PrimeQ[r*p + 1], p = NextPrime[p]]; p]; Array[a, 50]
Showing 1-1 of 1 results.