A177463 The smallest k such that Catalan(n)+k and Catalan(n)-k are both prime.
0, 3, 1, 5, 10, 3, 69, 33, 45, 45, 9, 47, 86, 97, 97, 41, 19, 49, 191, 11, 101, 283, 1, 69, 597, 549, 1341, 243, 552, 121, 157, 115, 1341, 1905, 165, 597, 27, 87, 31, 731, 1093, 449, 127, 37, 37, 157, 1145, 587, 317, 659, 1523, 487, 865, 4879, 463, 1351, 4471
Offset: 3
Keywords
Examples
5 +- 0 -> primes, 14 +- 3 -> primes, 42 +- 1 -> primes, 132 +- 5 -> primes, ...
Programs
-
Maple
A000108 := proc(n) binomial(2*n,n)/(n+1) ; end proc: A047160 := proc(n) for k from 0 to n-1 do if isprime(n-k) and isprime(n+k) then return k; end if; end do: return -1 ; end proc: A177463 := proc(n) A047160(A000108(n)) ; end proc: seq(A177463(n),n=3..40) ; # R. J. Mathar, Jan 23 2011
-
Mathematica
g[n_]:=(2n)!/n!/(n+1)!; f[n_]:=Block[{k},If[OddQ[n],k=0,k=1];While[ !PrimeQ[n-k]||!PrimeQ[n+k],k+=2];k]; Table[f[g[n]],{n,3,4*4!}]