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.

A330559 a(n) = (number of primes p <= prime(n) with Delta(p) == 2 (mod 4)) - (number of primes p <= prime(n) with Delta(p) == 0 (mod 4)), where Delta(p) = nextprime(p) - p.

This page as a plain text file.
%I A330559 #41 Mar 02 2024 13:17:25
%S A330559 0,1,2,1,2,1,2,1,2,3,4,3,4,3,4,5,6,7,6,7,8,7,8,7,6,7,6,7,6,7,6,7,8,9,
%T A330559 10,11,12,11,12,13,14,15,16,15,16,15,14,13,14,13,14,15,16,17,18,19,20,
%U A330559 21,20,21,22,23,22,23,22,23,24,25,26,25,26,25,26,27,26,27,26,25,24,25,26,27,28,29,28
%N A330559 a(n) = (number of primes p <= prime(n) with Delta(p) == 2 (mod 4)) - (number of primes p <= prime(n) with Delta(p) == 0 (mod 4)), where Delta(p) = nextprime(p) - p.
%C A330559 Equals A330560 - A330561.
%C A330559 Since Delta(prime(n)) grows roughly like log n, this probably changes sign infinitely often. When is the next time a(n) is zero, or the first time a(n) < 0 (if these values exist)?
%C A330559 Let s = A024675, the interprimes. For each n let E(n) = number of even terms of s that are <= n, and let O(n) = number of odd terms of s that are <= n. Then a(n+1) = E(n) - O(n). That is, as we progress through s, the number of evens stays greater than the number of odds. - _Clark Kimberling_, Feb 26 2024
%H A330559 N. J. A. Sloane, <a href="/A330559/b330559.txt">Table of n, a(n) for n = 1..99999</a>
%H A330559 StackExchange, <a href="https://math.stackexchange.com/questions/2307461/asymptotic-distribution-of-prime-gaps-in-residue-classes">Asymptotic Distribution of Prime Gaps in Residue Classes</a>.
%e A330559 n=6: prime(6) = 13, primes p <= 13 with Delta(p) == 2 (mod 4) are 3,5,11; primes p <= 13 with Delta(p) == 0 (mod 4) are 7,13; so a(6) = 3-2 = 1.
%t A330559 Join[{0}, Accumulate[Mod[Differences[Prime[Range[2, 100]]], 4] - 1]] (* _Paolo Xausa_, Feb 05 2024 *)
%Y A330559 Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330560, A330561.
%K A330559 nonn
%O A330559 1,3
%A A330559 _N. J. A. Sloane_, Dec 30 2019