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.

A247418 a(n) = Sum_{i=1..n} mu(i)*(-1)^(i+1).

Original entry on oeis.org

1, 2, 1, 1, 0, -1, -2, -2, -2, -3, -4, -4, -5, -6, -5, -5, -6, -6, -7, -7, -6, -7, -8, -8, -8, -9, -9, -9, -10, -9, -10, -10, -9, -10, -9, -9, -10, -11, -10, -10, -11, -10, -11, -11, -11, -12, -13, -13, -13, -13, -12, -12, -13, -13, -12, -12, -11, -12, -13
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 16 2014

Keywords

Comments

Alternating sums of mu(n), the Moebius function (A008683), from 1 to n.

Examples

			a(n) = mu(1) - mu(2) + mu(3) - mu(4) + ... + (-1)^(n+1) * mu(n).
		

Crossrefs

Cf. A008683 (moebius function).
Cf. A068773 (alternating sums of eulerphi(n)).
Cf. A068762 (alternating sums of sigma(n)).

Programs

  • Maple
    with(numtheory): A247418:=n->add(mobius(i)*(-1)^(i+1), i=1..n): seq(A247418(n), n=1..50);
  • Mathematica
    Table[Sum[MoebiusMu[i] (-1)^(i + 1), {i, n}], {n, 50}]
    Accumulate[Table[MoebiusMu[n](-1)^(n+1),{n,60}]] (* Harvey P. Dale, Oct 19 2018 *)
  • PARI
    a(n) = sum(i=1, n, moebius(i)*(-1)^(i+1)); \\ Michel Marcus, Sep 18 2014

Formula

a(n) = Sum_{i=1..n} A008683(i)*(-1)^(i+1).