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.

A344373 a(n) = Sum_{k=1..n-1} (-1)^k gcd(k, n).

Original entry on oeis.org

0, -1, 0, 0, 0, -1, 0, 4, 0, -1, 0, 8, 0, -1, 0, 16, 0, 3, 0, 16, 0, -1, 0, 36, 0, -1, 0, 24, 0, 15, 0, 48, 0, -1, 0, 48, 0, -1, 0, 68, 0, 23, 0, 40, 0, -1, 0, 112, 0, 15, 0, 48, 0, 27, 0, 100, 0, -1, 0, 120, 0, -1, 0, 128, 0, 39, 0, 64, 0, 47, 0, 180, 0, -1, 0, 72, 0, 47, 0, 208, 0, -1, 0, 176, 0, -1, 0, 164, 0, 99
Offset: 1

Views

Author

Max Alekseyev, May 16 2021

Keywords

Comments

The usual OEIS policy is not to include sequences like this where alternate terms are zero; this is an exception.
For all n, a(n) >= -1. Equality holds for n = 2 and n = 2*p for an odd prime p.

Crossrefs

Programs

Formula

a(n) = -A199084(n) - (-1)^n*n = (-1)^n * (A344371(n) - n).
a(2*n+1) = 0.
a(2*n) = A344372(n) - 2*n = -A106475(n-1).
Sum_{k=1..n} a(k) ~ (n^2/4) * ((4/Pi^2)*(log(n) + 2*gamma - 1/2 - 4*log(2)/3 - zeta'(2)/zeta(2)) - 1), where gamma is Euler's constant (A001620). - Amiram Eldar, Mar 30 2024

Extensions

More terms from Antti Karttunen, May 16 2021