A382117 a(n) = sum (-1)^(((x - 1)*(y - 1))/4), where x and y are coprime positive integers, equidistant from n, such that x <= y.
1, 1, 1, 2, 0, 2, 1, 4, 1, 4, 1, 4, 0, 6, 0, 8, 0, 6, 1, 8, 2, 10, 1, 8, 0, 12, 1, 12, 0, 8, 1, 16, 2, 16, 0, 12, 0, 18, 0, 16, 0, 12, 1, 20, 0, 22, 1, 16, 1, 20, 0, 24, 0, 18, 0, 24, 2, 28, 1, 16, 0, 30, 2, 32, 0, 20, 1, 32, 2, 24, 1, 24, 0, 36, 0, 36, 2, 24
Offset: 1
Keywords
Examples
a(4)=2 because (-1)^(((1 - 1)*(7 - 1))/4) + (-1)^(((3 - 1)*(5 - 1))/4) = (-1)^0 + (-1)^2 = 1 + 1 = 2.
Crossrefs
Cf. A309812 (indices of zeros).
Programs
-
PARI
a(n) = sum(x=1, n, my(y=2*n-x); if ((x<=y) && (gcd(x, y)==1), (-1)^(((x-1)*(y-1))/4))); \\ Michel Marcus, Apr 27 2025
Extensions
More terms from Alois P. Heinz, Apr 26 2025
Comments