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.

A368624 a(n) = Sum_{k = 1..n} (-1)^(n+k) * gcd(2*k, n).

Original entry on oeis.org

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

Views

Author

Peter Bala, Jan 01 2024

Keywords

Crossrefs

Programs

  • 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 *)

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).