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 A309158 #22 Jul 17 2019 17:29:35 %S A309158 5,11,13,23,31,47,47,53,67,67,73,101,101,107,113,131,139,151,151,151, %T A309158 173,179,193,193,227,227,233,241,241,283,283,293,293,313,313,353,353, %U A309158 353,353,397,397,397,421,421,421,461,461,467,467,503,503,503,521,563,569,599,599 %N A309158 The smallest prime, a(n), larger than prime(n) for which every even difference from 2 to prime(n) - 1 occurs at least once for some pair of primes from prime(n) to a(n) inclusive. %C A309158 The "prime differences prime" a(n) is the smallest prime greater than prime(n), n > 1, for which every even difference from 2 to prime(n)-1 occurs for some pair of primes from prime(n) to a(n) inclusive. %C A309158 a(n) is at least prime(n) + (prime(n) - 1) = 2 * prime(n) - 1. %C A309158 If the sequence of prime differences primes is infinite, there are infinitely many pairs of primes for each even difference. If there are only finitely many pairs of primes for some even difference, the sequence ends. %C A309158 Ratios a(n)/prime(n), n = 2 to 15 are 1.67, 2.20, 1.86, 2.09, 2.38, 2.76, 2.47, 2.30, 2.31, 2.16, 1.97, 2.46, 2.35, 2.28. %C A309158 Conjecture: The sequence is infinite. %C A309158 Conjecture: There are finitely many values of n with a(n) = 2 * prime(n) - 1. %C A309158 Conjecture: There are infinitely many values of n with a(n) = a(n-1). %C A309158 Conjecture: For all n, a(n) <= 3 * prime(n). (This is true for n <= 101.) %e A309158 For n = 4, prime(4) = 7 and 7 - 1 = 6. Check differences for 7 and 11: 11 - 7 = 4. For 7, 11, and 13: 11 - 7 = 4, 13 - 7 = 6, 13 - 11 = 2, so a(4) = 13. %e A309158 Also prime(6) = 13, 13 - 1 = 12. For 13, 17, 19, 23, 29 and 31, 29 - 17 = 12, 23 - 13 = 10, 31 - 23 = 8, 19 - 13 = 6, 17 - 13 = 4, 19 - 17 = 2, and a(6) = 31. %p A309158 for n from 2 to 58 do %p A309158 a := ithprime(n): %p A309158 for d from 2 by 2 to a - 1 do %p A309158 p := ithprime(n); %p A309158 while not isprime(p + d) do %p A309158 p := nextprime(p) %p A309158 od; %p A309158 if p + d > a then a := p + d fi %p A309158 od; %p A309158 print(n, a) %p A309158 od: # _Peter Luschny_, Jul 17 2019 %t A309158 For [n=2,n <= 101,n++, %t A309158 Clear[d];d=0; %t A309158 Clear[a];a=Prime[n]; %t A309158 While[d < Prime[n]-1, %t A309158 d=d+2; %t A309158 Clear[m];m=n; %t A309158 While[CompositeQ[d+Prime[m]],m++]; %t A309158 If[d+Prime[m] > a,a=d+Prime[m]]]; %t A309158 Print[{n,Prime[n],a,N[a/Prime[n]]}] %t A309158 ] %Y A309158 Cf. A000040, A006512, A046132, A046117. %K A309158 nonn %O A309158 2,1 %A A309158 _Sally Myers Moite_, Jul 14 2019