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.

A318734 a(n) = Sum_{k=1..n} (-1)^(k + 1) * d(2*k - 1), where d(k) is the number of divisors of k (A000005).

Original entry on oeis.org

1, -1, 1, -1, 2, 0, 2, -2, 0, -2, 2, 0, 3, -1, 1, -1, 3, -1, 1, -3, -1, -3, 3, 1, 4, 0, 2, -2, 2, 0, 2, -4, 0, -2, 2, 0, 2, -4, 0, -2, 3, 1, 5, 1, 3, -1, 3, -1, 1, -5, -3, -5, 3, 1, 3, -1, 1, -3, 3, -1, 2, -2, 2, 0, 4, 2, 6, -2, 0, -2, 2, -2
Offset: 1

Views

Author

Hugo Pfoertner, Sep 05 2018

Keywords

Crossrefs

Records and their positions: A318735, A318736, A318737, A318738.

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(k + 1) DivisorSigma[0, 2 k - 1], {k, 1, n}];
    Array[a, 100] (* Jean-François Alcover, Sep 17 2018 *)
  • PARI
    s=0;j=-1;forstep(k=1,141,2,j=-j;s=s+j*numdiv(k);print1(s,", "))
    
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*numdiv(2*k-1)); \\ Michel Marcus, Sep 08 2018