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.

A065358 The Jacob's Ladder sequence: a(n) = Sum_{k=1..n} (-1)^pi(k), where pi = A000720.

Original entry on oeis.org

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

Views

Author

Jason Earls, Oct 31 2001

Keywords

Comments

Partial sums of A065357.

Crossrefs

Cf. A000720, A065357, A064940 (the zero terms).

Programs

  • Maple
    with(numtheory): f:=n->add((-1)^pi(k),k=1..n); [seq(f(n),n=0..60)]; # N. J. A. Sloane, Feb 20 2018
  • Mathematica
    Table[Sum[(-1)^(PrimePi[k]), {k,1,n}], {n,0,100}] (* G. C. Greubel, Feb 20 2018 *)
    a[0] = 0; a[n_] := a[n] = a[n - 1] + (-1)^PrimePi[n]; Array[a, 105, 0] (* Robert G. Wilson v, Feb 20 2018 *)
  • PARI
    { a=0; for (n=1, 1000, a+=(-1)^primepi(n); write("b065358.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 30 2009
    [0] cat [(&+[(-1)^(#PrimesUpTo(k)):k in [1..n]]): n in [1..100]];  // G. C. Greubel, Feb 20 2018

Extensions

Edited by Frank Ellermann, Feb 02 2002
Edited by N. J. A. Sloane, Feb 20 2018 (added initial term a(0)=0, added name suggested by the Fraile et al. paper)