login
A368624
a(n) = Sum_{k = 1..n} (-1)^(n+k) * gcd(2*k, n).
0
1, 0, 3, 4, 5, 0, 7, 16, 9, 0, 11, 20, 13, 0, 15, 48, 17, 0, 19, 36, 21, 0, 23, 80, 25, 0, 27, 52, 29, 0, 31, 128, 33, 0, 35, 84, 37, 0, 39, 144, 41, 0, 43, 84, 45, 0, 47, 240, 49, 0, 51, 100, 53, 0, 55, 208, 57, 0, 59, 180, 61, 0, 63, 320, 65, 0, 67, 132, 69, 0
OFFSET
1,3
FORMULA
a(2*n+1) = 2*n + 1; a(4*n+2) = 0; a(4*n) = 4*A344372(n) = 4*Sum_{k = 1..n} gcd(2*k, n).
MAPLE
seq(add((-1)^(n+k) * gcd(2*k, n), k = 1..n), n = 1..70)
MATHEMATICA
Table[Sum[(-1)^(n+k) GCD[2k, n], {k, n}], {n, 70}] (* Harvey P. Dale, Jun 16 2024 *)
CROSSREFS
Sequence in context: A199066 A306584 A176948 * A113138 A010263 A011303
KEYWORD
nonn,easy
AUTHOR
Peter Bala, Jan 01 2024
STATUS
approved