cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Mike Jones, Apr 26 2025

Keywords

Comments

Sequence inspired by the law of quadratic reciprocity.

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