OFFSET
1,9
EXAMPLE
a(1) = 0 because 1*(1+1)-(2*0+1)=1 and 1*(1+1)+(2*0+1)=3 are both noncomposite numbers.
a(2) = 0 because 2*(2+1)-(2*0+1)=5 and 2*(2+1)+(2*0+1)=7 are both noncomposite numbers.
a(3) = 0 because 3*(3+1)-(2*0+1)=11 and 3*(3+1)+(2*0+1)=13 are both noncomposite numbers.
a(4) = 1 because 4*(4+1)-(2*1+1)=17 and 4*(4+1)+(2*1+1)=23 are both noncomposite numbers.
PROG
(PARI) isc(c) = (c>1) && !isprime(c);
a(n) = my(k=0); while (isc(n*(n+1)-(2*k+1)) || isc(n*(n+1)+(2*k+1)), k++); k; \\ Michel Marcus, Oct 16 2025
CROSSREFS
KEYWORD
sign
AUTHOR
Gerasimov Sergey, Mar 14 2012
EXTENSIONS
Corrected by R. J. Mathar, Mar 24 2012
STATUS
approved
