A208645 Least x>0 such that x^2+x+n is not prime.
2, 4, 1, 2, 1, 4, 1, 1, 1, 2, 1, 10, 1, 1, 1, 2, 1, 16, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 40, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1, 1, 1, 1
Offset: 0
Keywords
Examples
a(0)=2 since 1^2+1+0=2 is prime, but 2^2+2+0=6 is composite. a(1)=4 since 1^2+1+1=2, 2^2+2+1=7 and 3^2+3+1=13 are prime, but 4^2+4+1=21 is composite.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
lx[n_]:=Module[{x=1},While[PrimeQ[x^2+x+n],x++];x]; Array[lx, 90, 0] (* Harvey P. Dale, Aug 14 2013 *)
-
PARI
a(n)=for( x=1, n+3, isprime(x^2+x+n) || return(x))
Comments