login
a(n) = the least positive integer k such that binomial(2k,k) + k + n is prime, if such k exists; = 0, otherwise.
0

%I #20 Apr 15 2018 12:20:47

%S 1,0,1,2,1,2,3,6,1,2,1,2,5,120,1,2,1,6,3,58,1,2,7,2,3,12,1,4,1,2,3,12,

%T 9,2,1,2,3,6,1,2,1,6,19,16,1,2,13,6,3,12,1,2,7,2,5,16,1,4,1,2,3,6,15,

%U 2,1,2,3,6,1,14,1,2,7,16,3,2,1,4,3,6,1

%N a(n) = the least positive integer k such that binomial(2k,k) + k + n is prime, if such k exists; = 0, otherwise.

%C The value a(1) = 0 is conjectural. There is no k < 8.5 x 10^3 such that binomial(2k,k)+k+1 is prime.

%C There is no k < 10^8 making binomial(2k,k)+k+1 prime. - _Charles R Greathouse IV_, May 19 2013

%C a(1) = 0. k + 1 | binomial(2*k, k) = (2*k)! / (k!)^2 > 0 for k > 0 and k+1 | k + 1 so k+1 | binomial(2k,k)+k+1 = m * (k + 1) for m > 1 and hence isn't prime. - _David A. Corneth_, Mar 31 2018

%e k=6 is the least positive integer such that binomial(2k,k) + k + 7 is prime. Hence a(7) = 6.

%t lpk[n_]:=Module[{k=1},While[!PrimeQ[Binomial[2k,k]+k+n],k++];k]; Join[ {1,0},Array[lpk,90,2]] (* _Harvey P. Dale_, Mar 31 2018 *)

%o (PARI) a(n) = {k = 1; if(n == 1, return(0)); while(! isprime(binomial(2*k, k) + k + n), k++;); return (k);} \\ _Michel Marcus_, May 19 2013

%K nonn

%O 0,4

%A _Joseph L. Pe_, Jan 09 2003

%E a(0) = 1 prepended to sequence to match offset by _Michel Marcus_, May 19 2013

%E Example fixed by _Harvey P. Dale_, Mar 31 2018