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.

This page as a plain text file.
%I A065358 #60 Apr 13 2024 14:57:08
%S A065358 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,
%T A065358 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,
%U A065358 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
%N A065358 The Jacob's Ladder sequence: a(n) = Sum_{k=1..n} (-1)^pi(k), where pi = A000720.
%C A065358 Partial sums of A065357.
%H A065358 N. J. A. Sloane, <a href="/A065358/b065358.txt">Table of n, a(n) for n = 0..10000</a> (first 1000 terms from Harry J. Smith).
%H A065358 Alberto Fraile, Roberto Martínez, and Daniel Fernández, <a href="https://arxiv.org/abs/1801.01540">Jacob's Ladder: Prime numbers in 2d</a>, arXiv preprint arXiv:1801.01540 [math.HO], 2017. Also Prime Numbers in 2D, Math. Comput. Appl. 2020, 25, 5; https://www.mdpi.com/2297-8747/25/1/5 [They describe essentially this sequence except with offset 1 instead of 0 - _N. J. A. Sloane_, Feb 20 2018]
%H A065358 Hans Havermann, <a href="/A065358/a065358.png">Graph of first 30 million terms</a>. [As can seen from A064940, one has to go out beyond 44 million terms to see any further runs of positive terms.]
%p A065358 with(numtheory): f:=n->add((-1)^pi(k),k=1..n); [seq(f(n),n=0..60)]; # _N. J. A. Sloane_, Feb 20 2018
%t A065358 Table[Sum[(-1)^(PrimePi[k]), {k,1,n}], {n,0,100}] (* _G. C. Greubel_, Feb 20 2018 *)
%t A065358 a[0] = 0; a[n_] := a[n] = a[n - 1] + (-1)^PrimePi[n]; Array[a, 105, 0] (* _Robert G. Wilson v_, Feb 20 2018 *)
%o A065358 (PARI) { a=0; for (n=1, 1000, a+=(-1)^primepi(n); write("b065358.txt", n, " ", a) ) } \\ _Harry J. Smith_, Sep 30 2009
%o A065358 [0] cat [(&+[(-1)^(#PrimesUpTo(k)):k in [1..n]]): n in [1..100]];  // _G. C. Greubel_, Feb 20 2018
%Y A065358 Cf. A000720, A065357, A064940 (the zero terms).
%K A065358 easy,sign,nice
%O A065358 0,5
%A A065358 _Jason Earls_, Oct 31 2001
%E A065358 Edited by _Frank Ellermann_, Feb 02 2002
%E A065358 Edited by _N. J. A. Sloane_, Feb 20 2018 (added initial term a(0)=0, added name suggested by the Fraile et al. paper)