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.

A230663 Least prime p such that x^2 + 3*x + p produces primes for x = 0..n-1 but not x = n.

Original entry on oeis.org

2, 67, 3, 349, 79, 439, 21559, 14713, 13, 8123233, 223, 3468214093, 1701300344203, 11613197109589, 19
Offset: 1

Views

Author

Zak Seidov, Oct 27 2013

Keywords

Comments

a(39) = 43 and all other terms > 128865958933.

Crossrefs

Cf. A164926.

Programs

  • Mathematica
    Table[p = 2; While[! (Union[Table[PrimeQ[x^2 + 3*x + p], {x, 0, n - 1}]] == {True} && PrimeQ[n^2 + 3*n + p] == False), p = NextPrime[p]]; p, {n, 9}] (* T. D. Noe, Oct 29 2013 *)
  • PARI
    isok(p, n) = for (k=0, n-1, if(!isprime(p + k*(k+3)), return(0))); return(!isprime(p + n*(n+3)));
    a(n) = forprime(p=2, oo, if(isok(p, n), return(p))); \\ Daniel Suteu, Dec 22 2024
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + $n*($n+3)) } sieve_prime_cluster($lo, $hi, map { $*($+3) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " } # Daniel Suteu, Dec 22 2024

Extensions

a(13)-a(15) from Daniel Suteu, Dec 22 2024