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.

This page as a plain text file.
%I A230663 #16 Dec 22 2024 10:18:29
%S A230663 2,67,3,349,79,439,21559,14713,13,8123233,223,3468214093,
%T A230663 1701300344203,11613197109589,19
%N A230663 Least prime p such that x^2 + 3*x + p produces primes for x = 0..n-1 but not x = n.
%C A230663 a(39) = 43 and all other terms > 128865958933.
%H A230663 R. A. Mollin, <a href="http://www.jstor.org/stable/2975080">Prime-producing quadratics</a>, Amer. Math. Monthly 104 (1997), 529-544.
%t A230663 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 *)
%o A230663 (PARI) isok(p, n) = for (k=0, n-1, if(!isprime(p + k*(k+3)), return(0))); return(!isprime(p + n*(n+3)));
%o A230663 a(n) = forprime(p=2, oo, if(isok(p, n), return(p))); \\ _Daniel Suteu_, Dec 22 2024
%o A230663 (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
%Y A230663 Cf. A164926.
%K A230663 nonn,more
%O A230663 1,1
%A A230663 _Zak Seidov_, Oct 27 2013
%E A230663 a(13)-a(15) from _Daniel Suteu_, Dec 22 2024