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.

A092243 Score at stage n in "tug of war" between prime gap increases vs. prime gap decreases: start with score = 0 at n = 1 and at stage n = k > 1, increase (resp. decrease) the score by 1 if the k-th prime gap is greater (resp. less) than the previous prime gap.

This page as a plain text file.
%I A092243 #35 May 13 2019 15:33:49
%S A092243 0,1,1,2,1,2,1,2,3,2,3,2,1,2,3,3,2,3,2,1,2,1,2,3,2,1,2,1,2,3,2,3,2,3,
%T A092243 2,3,3,2,3,3,2,3,2,3,2,3,3,2,1,2,3,2,3,2,2,2,1,2,1,0,1,2,1,0,1,2,1,2,
%U A092243 1,2,3,4,3,3,2,3,4,3,4,5,4,5,4,5,4,5,6,5,4,5,6,5,4,5,4,5,6,5,6,5,6,5,5,4,5
%N A092243 Score at stage n in "tug of war" between prime gap increases vs. prime gap decreases: start with score = 0 at n = 1 and at stage n = k > 1, increase (resp. decrease) the score by 1 if the k-th prime gap is greater (resp. less) than the previous prime gap.
%C A092243 a(n) is nonnegative for n = 1,...,41252. At n = 41253, a(n) = -1. At most larger values of n, up to n = 250000 (as far as I've checked), a(n) is overwhelmingly negative.
%C A092243 Questions. Is s > 0 for some n > 250000? Is s bounded from below? Is s bounded from above? Is s > 0 for infinitely many values of n? Is s < 0 for infinitely many values of n?
%H A092243 N. J. A. Sloane, <a href="/A092243/b092243.txt">Table of n, a(n) for n = 1..20000</a>
%H A092243 Pe, J. L., <a href="http://www.numeratus.net/pgtow/pgtow.html">Prime Gap Tug of War</a>, 2002
%H A092243 Pe, J. L., <a href="/A092243/a092243.pdf">Prime Gap Tug of War</a>, 2002 [Cached copy, pdf file only, with permission.] Shows extended graphs.
%H A092243 C. Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_271.htm">Puzzle 271: Prime gap tug of war</a>.
%H A092243 N. J. A. Sloane, <a href="/A092243/a092243.txt">Table of n, a(n) for n = 1..100000</a>
%H A092243 N. J. A. Sloane, <a href="/A092243/a092243_1.txt">Table of n, a(n) for n = 1..965562</a>
%F A092243 Cumulative sums of A079054 (negated).
%e A092243 At stage n = 1, the score a(1) = 0. The first prime gap is 3-2 = 1.
%e A092243 At stage n = 2, the second prime gap is 5-3 = 2 > 1, the previous prime gap. Hence a(2) = a(1) + 1 = 0 + 1 = 1.
%e A092243 At stage n = 3, the third prime gap is 7-5 = 2, which equals the previous prime gap. The score doesn't change; hence a(3) = 1.
%e A092243 At stage n = 4, the fourth prime gap is 11-7 = 4 > 2, the third prime gap. Hence a(4) = a(3) + 1 = 1+1 = 2.
%p A092243 # From _N. J. A. Sloane_, Mar 13 2016 (a is A079054, ss is the present sequence):
%p A092243 a:=[]; ss:=[0]; s:=0; M:=120; for n from 2 to M-1 do
%p A092243 q:=ithprime(n); p:=prevprime(q); r:=nextprime(q);
%p A092243 if q-p < r-q then a:=[op(a),-1]; s:=s+1;
%p A092243 elif q-p=r-q then a:=[op(a),0]; else a:=[op(a),1]; s:=s-1; fi;
%p A092243 ss:=[op(ss),s];
%p A092243 od:
%p A092243 a; ss;
%t A092243 d = 1; c = 3; s = 0; r = {0}; For[i = 2, i <= 200, i++, e = Prime[i + 1]; newd = e - c; c = e; If[newd > d, s = s + 1, If[newd < d, s = s - 1]]; d = newd; r = Append[r, s]]; r
%Y A092243 Cf. A079054.
%Y A092243 For indices where there is a strict sign change see A269737.
%Y A092243 For positions of records see A269738, A269739.
%Y A092243 Positions of zeros: A175102.
%K A092243 sign
%O A092243 1,4
%A A092243 _Joseph L. Pe_, Feb 19 2004