login
Smallest k>=0 such that n(n+1)-(2k+1) and n(n+1)+(2k+1) are both noncomposite numbers, or -1 if no such k exists.
0

%I #14 Mar 31 2012 10:33:09

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

%T 14,1,11,14,16,0,3,13,0,2,7,3,8,25,6,2,4,0,2,22,12,0,19,5,3,85,0,8,7,

%U 8,9,34,3,0,46,14,15,1,17,11,7,9,5,4,33,5,1,5,30,13,2,5,61,2,6,4,0,9,37,8,2,34,8,14,7,20,14,16

%N Smallest k>=0 such that n(n+1)-(2k+1) and n(n+1)+(2k+1) are both noncomposite numbers, or -1 if no such k exists.

%e a(1) = 0 because 1*(1+1)-(2*0+1)=1 and 1*(1+1)+(2*0+1)=3 are both noncomposite numbers,

%e a(2) = 0 because 2*(2+1)-(2*0+1)=5 and 2*(2+1)+(2*0+1)=7 are both noncomposite numbers,

%e a(3) = 0 because 3*(3+1)-(2*0+1)=11 and 3*(3+1)+(2*0+1)=13 are both noncomposite numbers,

%e a(4) = 1 because 4*(4+1)-(2*1+1)=17 and 4*(4+1)+(2*1+1)=23 are both noncomposite numbers.

%Y Cf. A002378, A008578.

%K sign

%O 1,9

%A _Gerasimov Sergey_, Mar 14 2012

%E Corrected by R. J. Mathar, Mar 24 2012