login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A362465
a(n) is the least number of 2 or more consecutive signed primes whose sum equals n.
4
3, 2, 2, 4, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3
OFFSET
0,1
COMMENTS
Inspired by a conjecture made by Carlos Rivera in 2000 (see link). Here we remove Rivera's restriction that the primes have to be smaller than n.
For every positive even n, a(n) = 2, provided there are 2 consecutive primes separated by a gap of size n. Polignac's conjecture says: "For any positive even number n, there are infinitely many prime gaps of size n." If so, a(3) is the only 4 in this sequence, as any even number of consecutive odd signed primes has an even sum.
There is also the reversed sequence for negative n with 0 as the symmetry point.
See A362466 for the first occurrences of numbers in this sequence.
LINKS
Karl-Heinz Hofmann, Examples for n = 0 to 253
Thomas R. Nicely, First occurrence prime gaps
Carlos Rivera, Conjecture 21. Rivera's conjecture, The Prime Puzzles and Problems Connection.
Wikipedia, Prime Gap.
Yitang Zhang, Bounded gaps between primes, Annals of Mathematics, Volume 179 (2014), Issue 3, pp. 1121-1174.
FORMULA
a(n) = a(-n).
EXAMPLE
a(1) = 2: -2 + 3 = 1.
a(0) = 3: -2 - 3 + 5 = 0.
a(3) = 4: 2 + 3 + 5 - 7 = 3.
The example below for a(29) gives more detail of the general method employed.
a(29) = 5: 3 - 5 + 7 + 11 + 13 = 29.
Since any even number of consecutive odd signed primes has an even sum, we can show a(29) <> 4.
A test with all triples of consecutive signed primes up to 10^9 gave no solution for 29. The estimated lower bound for the permutation p1 + p2 - p3 is p1 - (p1 + 2)^0.525 and was never surpassed. (See Wikipedia link. "A result, due to Baker, Harman and Pintz in 2001, shows that Theta may be taken to be 0.525".) So the terms are calculated with the assumption that this is true.
PROG
(Python)
from sympy import primepi, sieve as prime
import numpy
upto = 50000 # 5000000 good for 8 GB RAM (3 Minutes)
primepi_of_upto, np, arr = primepi(upto), 1, []
A362465 = numpy.zeros(upto + 1, dtype="i4")
A362465[2:][::2] = 2 # holds if "upto" < 7 * 10^7
for n in range(1, primepi_of_upto + 1): arr.append([prime[n]])
while all(A362465) == 0:
np += 1
for k in range(0, primepi_of_upto):
temp = []
for i in arr[k]:
temp.append(i + prime[k+np])
temp.append(abs(i - prime[k+np]))
arr[k] = set(temp)
for n in temp:
if n <= upto and A362465[n] == 0: A362465[n] = np
print(list(A362465[0:100]))
CROSSREFS
Cf. A000230, A001632, A362466 (first occurrences).
Sequence in context: A117643 A141862 A237612 * A111739 A376310 A372490
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Apr 21 2023
EXTENSIONS
Edited by Peter Munn, Aug 08 2023
STATUS
approved