A229021 Record values in A226657.
5, 7, 23, 389, 409, 1511, 5309, 7351, 37223, 142811, 763271, 8066923, 9182389, 10237391, 24374033, 70353383, 128463691, 334100083, 358453847, 610611193
Offset: 1
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.
The following table, based on a very much larger table in the web page of Tomás Oliveira e Silva (see link) shows, for each gap g, P(g) = the smallest prime such that P(g)+g is the smallest prime number larger than P(g); * marks a record-holder: g is a record-holder if P(g') > P(g) for all (even) g' > g, i.e., if all prime gaps are smaller than g for all primes smaller than P(g); P(g) is a record-holder if P(g') < P(g) for all (even) g' < g. This table gives rise to many sequences: P(g) is A000230, the present sequence; P(g)* is A133430; the positions of the *'s in the P(g) column give A100180, A133430; g* is A005250; P(g*) is A002386; etc. ----- g P(g) ----- 1* 2* 2* 3* 4* 7* 6* 23* 8* 89* 10 139* 12 199* 14* 113 16 1831* 18* 523 20* 887 22* 1129 24 1669 26 2477* 28 2971* 30 4297* 32 5591* 34* 1327 36* 9551* ........ The first time a gap of 4 occurs between primes is between 7 and 11, so a(2)=7 and A001632(2)=11.
Join[{2}, With[{pr = Partition[Prime[Range[86000]], 2, 1]}, Transpose[ Flatten[ Table[Select[pr, #[[2]] - #[[1]] == 2n &, 1], {n, 50}], 1]][[1]]]] (* Harvey P. Dale, Apr 20 2012 *)
a(n)=my(p=2);forprime(q=3,,if(q-p==2*n,return(p));p=q) \\ Charles R Greathouse IV, Nov 20 2012
use ntheory ":all"; my($l,$i,@g)=(2,0); forprimes { $g[($-$l) >> 1] //= $l; while (defined $g[$i]) { print "$i $g[$i]\n"; $i++; } $l=$; } 1e10; # Dana Jacobsen, Mar 29 2019
import numpy from sympy import sieve as prime aupto = 50 A000230 = np.zeros(aupto+1, dtype=object) A000230[0], it = 2, 2 while all(A000230) == 0: gap = (prime[it+1] - prime[it]) // 2 if gap <= aupto and A000230[gap] == 0: A000230[gap] = prime[it] it += 1 print(list(A000230)) # Karl-Heinz Hofmann, Jun 07 2023
Difference two - primes: 5, 7, 11, 13, 17, 19. Difference four - primes: 7, 11, 13, 17, 19, 23. Difference six - primes: 251, 257, 263, 269, 271, 277.
Table[With[{prs=Partition[Prime[Range[42000000]],6,1]},Select[prs, Union[ Take[ Differences[#1],{1,5,2}]]=={2n}&,1][[1,1]]],{n,30}] (* Harvey P. Dale, Apr 18 2014 *)
See also the table of the sublists in the examples for A362017. a(1) = 1 because L_1 = {2} by definition. In the following examples we use p_0 to denote prevprime(p_1). a(2) = 1. For the 2nd sublist, p_1 - p_0 = 3 - 2 = 1. If the next prime, 5, is in L_2, then p_2 - p_1 = 2 > p_1 - p_0. Therefore, 5 does not belong to L_2 and L_2 = {3}. a(5) = 2. For the 5th sublist, p_1 - p_0 = 11 - 7 = 4. p_2 = 13 is in L_5 because p_2 - p_1 = 2 < p_1 - p_0. However, the next prime, 17, is not in L_5 as 17 - 13 > p_2 - p_1. Thus, L_5 = {11, 13}. a(15) = 6. L_15 = {97, 101, 103, 107, 109, 113}, because p_1 - p_0 = 97-89 > p_2 - p_1 = 101-97 = 4, which is the maximum prime gap in L_15. 127, the prime after 113, is not in L_15 as 127-113 = 14 > p_2 - p_1.
from sympy import nextprime L = [2] for n in range(1, 100): print(len(L), end =', ') p0 = L[-1]; p1 = nextprime(p0); M = [p1]; g0 = p1 - p0; p = nextprime(p1); g1 = p - p1 while g1 < g0 and p - p1 <= g1: M.append(p); p1 = p; p = nextprime(p) L = M
[n: n in [2..2*10^6 ] | (NextPrime(n)-NextPrime(n-1)) eq 62]; // Vincenzo Librandi, Jul 02 2015
p:= 2: count:= 0: while count < 40 do q:= nextprime(p); if q - p = 62 then count:= count+1; A[count]:= p; fi; p:= q; od: seq(A[i],i=1..count); # Robert Israel, Jul 02 2015
Select[Prime@ Range@ 120000, NextPrime@ # - # == 62 &] (* Michael De Vlieger, Jul 01 2015 *) Select[Partition[Prime[Range[120000]],2,1],#[[2]]-#[[1]]==62&][[All,1]] (* Harvey P. Dale, Apr 01 2017 *)
g=62;c=o=0;forprime(p=1,default(primelimit),(-o+o=p)==g&write("c:/temp/b204669.txt",c++" "p-g)) \\ M. F. Hasler, Jan 18 2012
Comments