login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least number k such that n^2 + n + k is prime.
1

%I #14 Jul 05 2017 02:54:08

%S 2,1,1,1,3,1,1,3,1,7,3,5,1,9,1,1,5,1,5,3,1,1,3,5,1,3,7,1,9,7,7,5,5,1,

%T 3,17,29,3,1,7,17,1,5,9,7,11,17,11,5,9,1,5,11,17,1,3,11,1,11,1,11,11,

%U 1,17,17,7,1,5,11,1,3,1,5,5,7,1,5,1,1,3,1,11,17,5,11,11

%N Least number k such that n^2 + n + k is prime.

%C a(A002384(n)) = 1.

%C a(A027752(n)) = 3, for n > 2.

%H Robert Israel, <a href="/A289356/b289356.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A013632(A002378(n)). - _Robert Israel_, Jul 05 2017

%p seq(nextprime(n^2+n)-(n^2+n), n=0..100); # _Robert Israel_, Jul 05 2017

%t Table[k = 1; While[! PrimeQ[n^2 + n + k], k++]; k, {n, 0, 85}] (* _Michael De Vlieger_, Jul 04 2017 *)

%o (PARI) for(n=0,85,k={my(k=1);while(!isprime(n^2+n+k),k++);k;};print1(k", "))

%Y Cf. A002378, A002384, A013632, A027752, A182047 (resulting primes).

%K nonn

%O 0,1

%A _Gionata Neri_, Jul 03 2017