OFFSET
1,3
COMMENTS
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)?
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
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..99999
StackExchange, Asymptotic Distribution of Prime Gaps in Residue Classes.
EXAMPLE
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.
MATHEMATICA
Join[{0}, Accumulate[Mod[Differences[Prime[Range[2, 100]]], 4] - 1]] (* Paolo Xausa, Feb 05 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 30 2019
STATUS
approved