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.
%I A362465 #94 Aug 08 2023 18:03:14 %S A362465 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, %T A362465 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, %U A362465 2,3,2,3,2,3,2,3,2,3,2,5,2,3,2,3,2,3,2,5,2,3 %N A362465 a(n) is the least number of 2 or more consecutive signed primes whose sum equals n. %C A362465 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. %C A362465 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. %C A362465 There is also the reversed sequence for negative n with 0 as the symmetry point. %C A362465 See A362466 for the first occurrences of numbers in this sequence. %H A362465 Karl-Heinz Hofmann, <a href="/A362465/b362465.txt">Table of n, a(n) for n = 0..40000</a> %H A362465 Karl-Heinz Hofmann, <a href="/A362465/a362465.txt">Examples for n = 0 to 253</a> %H A362465 Karl-Heinz Hofmann, <a href="/A362465/a362465_2.png">Possible solutions for a(n) = 3</a> %H A362465 Karl-Heinz Hofmann, <a href="/A362465/a362465_1.png">Possible solutions for a(n) = 5</a> %H A362465 Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> %H A362465 Carlos Rivera, <a href="https://www.primepuzzles.net/conjectures/conj_021.htm">Conjecture 21. Rivera's conjecture</a>, The Prime Puzzles and Problems Connection. %H A362465 Wikipedia, <a href="https://en.wikipedia.org/wiki/Prime_gap">Prime Gap</a>. %H A362465 Yitang Zhang, <a href="https://doi.org/10.4007/annals.2014.179.3.7">Bounded gaps between primes</a>, Annals of Mathematics, Volume 179 (2014), Issue 3, pp. 1121-1174. %F A362465 a(n) = a(-n). %e A362465 a(1) = 2: -2 + 3 = 1. %e A362465 a(0) = 3: -2 - 3 + 5 = 0. %e A362465 a(3) = 4: 2 + 3 + 5 - 7 = 3. %e A362465 The example below for a(29) gives more detail of the general method employed. %e A362465 a(29) = 5: 3 - 5 + 7 + 11 + 13 = 29. %e A362465 Since any even number of consecutive odd signed primes has an even sum, we can show a(29) <> 4. %e A362465 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. %o A362465 (Python) %o A362465 from sympy import primepi, sieve as prime %o A362465 import numpy %o A362465 upto = 50000 # 5000000 good for 8 GB RAM (3 Minutes) %o A362465 primepi_of_upto, np, arr = primepi(upto), 1, [] %o A362465 A362465 = numpy.zeros(upto + 1, dtype="i4") %o A362465 A362465[2:][::2] = 2 # holds if "upto" < 7 * 10^7 %o A362465 for n in range(1,primepi_of_upto + 1): arr.append([prime[n]]) %o A362465 while all(A362465) == 0: %o A362465 np += 1 %o A362465 for k in range(0,primepi_of_upto): %o A362465 temp = [] %o A362465 for i in arr[k]: %o A362465 temp.append(i + prime[k+np]) %o A362465 temp.append(abs(i - prime[k+np])) %o A362465 arr[k] = set(temp) %o A362465 for n in temp: %o A362465 if n <= upto and A362465[n] == 0: A362465[n] = np %o A362465 print(list(A362465[0:100])) %Y A362465 Cf. A000040, A001223, A034961, A034964, A127334, A127336, A127338. %Y A362465 Cf. A000230, A001632, A362466 (first occurrences). %K A362465 nonn %O A362465 0,1 %A A362465 _Karl-Heinz Hofmann_, Apr 21 2023 %E A362465 Edited by _Peter Munn_, Aug 08 2023