Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a064940 -id:a064940
     Sort: relevance | references | number | modified | created      Format: long | short | data
The Jacob's Ladder sequence: a(n) = Sum_{k=1..n} (-1)^pi(k), where pi = A000720.
+10
12
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,5
COMMENTS
Partial sums of A065357.
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..10000 (first 1000 terms from Harry J. Smith).
Alberto Fraile, Roberto Martínez, and Daniel Fernández, Jacob's Ladder: Prime numbers in 2d, 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]
Hans Havermann, Graph of first 30 million terms. [As can seen from A064940, one has to go out beyond 44 million terms to see any further runs of positive terms.]
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 *)
PROG
(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
CROSSREFS
Cf. A000720, A065357, A064940 (the zero terms).
KEYWORD
easy,sign,nice
AUTHOR
Jason Earls, Oct 31 2001
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)
STATUS
approved
Values of k such that A065358(k-1) = 0.
+10
1
1, 3, 7, 35, 39, 43, 51, 55, 79, 87, 91, 107, 111, 115, 835, 843, 1391, 1407, 1411, 1471, 1579, 1587, 1651, 1663, 1843, 1851, 3383, 3491, 3507, 3515, 3519, 3547, 3659, 3691, 3719, 3747, 3779, 3819, 3823, 3843, 3851, 3855, 3871, 3899, 3939, 3947, 3987, 3991
OFFSET
1,2
COMMENTS
Obtained by adding 1 to the terms of A064940.
Fraile et al. (2017) describe essentially the same sequence as A065358 except with offset 1 instead of 0. So the present sequence gives the values of k so that their version of the Jacob's Ladder sequence has the value 0.
For the first 7730 terms, see the b-file in A064940.
LINKS
Alberto Fraile, Roberto Martínez, and Daniel Fernández, Jacob's Ladder: Prime numbers in 2d, arXiv preprint arXiv:1801.01540 [math.HO], 2017.
MATHEMATICA
A065358:= Table[Sum[(-1)^(PrimePi[k]), {k, 1, n}], {n, 0, 500}]; Select[Range[50], A065358[[#]] == 0 &] (* G. C. Greubel, Feb 20 2018 *)
PROG
(Python)
from sympy import nextprime
A299300_list, p, d, n, r = [], 2, -1, 0, False
while n <= 10**6:
pn, k = p-n, d if r else -d
if 0 < k <= pn:
A299300_list.append(n+k)
d += -pn if r else pn
r, n, p = not r, p, nextprime(p) # Chai Wah Wu, Feb 21 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2018
STATUS
approved

Search completed in 0.007 seconds