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.

A165234 Least prime p such that 2x^2 + p produces primes for x=0..n-1 and composite for x=n.

This page as a plain text file.
%I A165234 #17 Feb 16 2025 08:33:11
%S A165234 2,17,3,1481,5,149,569,2081,2339,5939831,11,33164857769,3217755097229,
%T A165234 272259344081,17762917045631
%N A165234 Least prime p such that 2x^2 + p produces primes for x=0..n-1 and composite for x=n.
%C A165234 Other known values: a(14)=272259344081 and a(29)=29. There are no other terms less than 10^12. The primes p = 3, 5, 11, and 29 produce p consecutive distinct primes because the imaginary quadratic field Q(sqrt(-2p)) has class number 2. Assuming the prime k-tuples conjecture, this sequence is defined for n>0.
%D A165234 Paulo Ribenboim, My Numbers, My Friends, Springer,2000, pp. 349-350.
%H A165234 R. A. Mollin, <a href="http://www.jstor.org/stable/2975080">Prime-producing quadratics</a>, Amer. Math. Monthly 104 (1997), 529-544.
%H A165234 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/Prime-GeneratingPolynomial.html">Prime-Generating Polynomial</a>
%t A165234 PrimeRun[p_Integer] := Module[{k=0}, While[PrimeQ[2k^2+p], k++ ]; k]; nn=9; t=Table[0,{nn}]; cnt=0; p=1; While[cnt<nn, p=NextPrime[p]; n=PrimeRun[p]; If[n<=nn && t[[n]]==0, t[[n]]=p; cnt++ ]]; t
%o A165234 (PARI) isok(p, n) = for (k=0, n-1, if(!isprime(p + 2*k^2), return(0))); return(!isprime(p + 2*n^2));
%o A165234 a(n) = forprime(p=2, oo, if(isok(p, n), return(p))); \\ _Daniel Suteu_, Dec 22 2024
%o A165234 (Perl) use ntheory qw(:all); sub a { my $n = $_[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($_ + 2*$n*$n) } sieve_prime_cluster($lo, $hi, map { 2*$_*$_ } 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 A165234 Cf. A007641, A050265, A161008, A164926.
%K A165234 hard,nonn,more
%O A165234 1,1
%A A165234 _T. D. Noe_, Sep 09 2009
%E A165234 a(13) and a(15) from _Daniel Suteu_, Dec 22 2024