login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A344371
a(n) = Sum_{k=1..n} (-1)^(n-k) gcd(k,n).
6
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,3
LINKS
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
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(n-k)*gcd(k, n)); \\ Michel Marcus, May 16 2021
KEYWORD
nonn,easy
AUTHOR
Max Alekseyev, May 16 2021
EXTENSIONS
More terms from Felix Fröhlich, May 19 2021
STATUS
approved