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.

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

Original entry on oeis.org

1, 1, 3, 4, 5, 5, 7, 12, 9, 9, 11, 20, 13, 13, 15, 32, 17, 21, 19, 36, 21, 21, 23, 60, 25, 25, 27, 52, 29, 45, 31, 80, 33, 33, 35, 84, 37, 37, 39, 108, 41, 65, 43, 84, 45, 45, 47, 160, 49, 65, 51, 100, 53, 81, 55, 156, 57, 57, 59, 180, 61, 61, 63, 192, 65, 105
Offset: 1

Views

Author

Max Alekseyev, May 16 2021

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=1, n, (-1)^(n-k)*gcd(k,n)); \\ Michel Marcus, May 16 2021

Formula

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

Extensions

More terms from Felix Fröhlich, May 19 2021