A089220 Duplicate of A052243.
642427, 1058861, 3431903, 4176587, 4560121, 4721047, 5072269, 5145403
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.
a(1) = 251 = prime(54) = A000040(54) and prime(55) - prime(54) = prime(56)-prime(55) = 6. - _Zak Seidov_, Apr 23 2011
Select[Partition[Prime[Range[9000]],4,1],Length[Union[Differences[#]]] == 1&][[All,1]] (* Harvey P. Dale, Aug 08 2017 *)
p=2;q=3;r=5;forprime(s=7,1e4, t=s-r; if(t==r-q&&t==q-p, print1(p", ")); p=q;q=r;r=s) \\ Charles R Greathouse IV, Feb 14 2013
251, 257, 263, 269 are consecutive primes: 257 = 251 + 6, 263 = 251 + 12, 269 = 251 + 18.
N:=10^5: # to get all terms <= N. Primes:=select(isprime,[seq(i,i=3..N+18,2)]): Primes[select(t->[Primes[t+1]-Primes[t], Primes[t+2]-Primes[t+1], Primes[t+3]-Primes[t+2]]=[6,6,6], [$1..nops(Primes)-3])]; # Muniru A Asiru, Aug 04 2017
A033451 = Reap[ For[p = 2, p < 100000, p = NextPrime[p], p2 = NextPrime[p]; If[p2 - p == 6, p3 = NextPrime[p2]; If[p3 - p2 == 6, p4 = NextPrime[p3]; If[p4 - p3 == 6, Sow[p]]]]]][[2, 1]] (* Jean-François Alcover, Jun 28 2012 *) Transpose[Select[Partition[Prime[Range[16000]],4,1],Union[ Differences[ #]] == {6}&]][[1]] (* Harvey P. Dale, Jun 17 2014 *)
p=2;q=3;r=5;forprime(s=7,1e4,if(s-p==18 && s-q==12 && s-r==6, print1(p", ")); p=q;q=r;r=s) \\ Charles R Greathouse IV, Feb 14 2013
First and smallest occurrence of n, n >= 1, consecutive primes in arithmetic progression: a(1) = 2: (2) (degenerate arithmetic progression); a(2) = 2: (2, 3) (degenerate arithmetic progression); a(3) = 3: (3, 5, 7); a(4) = 251: (251, 257, 263, 269); a(5) = 9843019: (9843019, 9843049, 9843079, 9843109, 9843139); a(6) = 121174811: (121174811, 121174841, 121174871, 121174901, 121174931, 121174961);
Join[{2},Table[SelectFirst[Partition[Prime[Range[691*10^4]],n,1], Length[ Union[ Differences[ #]]] == 1&][[1]],{n,2,6}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 10 2019 *)
A033447 = Reap[For[p = 2, p < 1100000, p = NextPrime[p], p2 = NextPrime[p]; If[p2 - p == 12, p3 = NextPrime[p2]; If[p3 - p2 == 12, p4 = NextPrime[p3]; If[p4 - p3 == 12, Sow[p]]]]]][[2, 1]] (* Jean-François Alcover, Jun 28 2012 *) Transpose[Select[Partition[Prime[Range[160000]],4,1],Union[ Differences[#]] =={12}&]][[1]] (* Harvey P. Dale, Jun 17 2014 *)
A033447(n, p=2, show_all=1, g=12,c,o)={forprime(q=p+1,, if(p+g!=p=q, next, q!=o+2*g, c=2, c++>3, show_all&& print1(o-g", "); n--||break); o=q-g); o-g} \\ Can be used as next(p)=A033447(1, p+1) to get the next term, e.g.: p=0; A033447_vec=vector(30,i,p=A033447(1,p+1)) \\ M. F. Hasler, Oct 26 2018
{74453, 74471, 74489, 74507} is the first such set of 4 consecutive primes with common difference 18, so a(1) = 74453.
A033448 = Reap[For[p = 2, p < 2100000, p = NextPrime[p], p2 = NextPrime[p]; If[p2 - p == 18, p3 = NextPrime[p2]; If[p3 - p2 == 18, p4 = NextPrime[p3]; If[p4 - p3 == 18, Sow[p]]]]]][[2, 1]] (* Jean-François Alcover, Jun 28 2012 *) Transpose[Select[Partition[Prime[Range[160000]],4,1],Union[ Differences[ #]] == {18}&]][[1]] (* Harvey P. Dale, Jun 17 2014 *)
A033448(n,show_all=1,g=18,p=2,o,c)={forprime(q=p+1,,if(p+g!=p=q,next, q!=o+2*g, c=3, c++>4, print1(o-g","); n--||break); o=q-g);o-g} \\ Can be used as nxt(p)=A033448(1,,,p+1), e.g.: {p=0;vector(20,i,p=nxt(p))} or {p=0;for(i=1,1e4,write("b.txt",i" "nxt(p)))}. - M. F. Hasler, Oct 26 2018
Select[Partition[Prime[Range[14000000]],5,1],Length[Union[ Differences[ #]]]==1&] (* Harvey P. Dale, Jun 22 2013 *)
A059044(n,p=2,c,g,P)={forprime(q=p+1,, if(p+g!=p+=g=q-p, next, q!=P+2*g, c=3, c++>4, print1(P-2*g,",");n--||break);P=q-g);P-2*g} \\ This does not impose the gap to be 30, but it happens to be the case for the first values. - M. F. Hasler, Oct 26 2018
A052242 = Reap[For[p = 2, p < 16000000, p = NextPrime[p], p2 = NextPrime[p]; If[p2 - p == 24, p3 = NextPrime[p2]; If[p3 - p2 == 24, p4 = NextPrime[p3]; If[p4 - p3 == 24, Print[p]; Sow[p]]]]]][[2, 1]] (* Jean-François Alcover, Jun 28 2012 *) Transpose[Select[Partition[Prime[Range[1100000]],4,1],Union[ Differences[#]] == {24}&]][[1]] (* Harvey P. Dale, Jun 17 2014 *)
Transpose[Select[Partition[Prime[Range[8700000]],4,1], Union[ Differences[#]] =={36}&]][[1]]
d[x_] := Prime[x+1]-Prime[x] {k1=42, k2=42, k3=42} k=0 Do[If[Equal[d[n], k1]&&Equal[d[n+1], k2]&& Equal[d[n+2], k3], k=k+1; Print[{k, n, Prime[n], Prime[n+1], Prime[n+2], Prime[n+3]}]], {n, 1, 10000000}] Transpose[Select[Partition[Prime[Range[9000000]], 4, 1], Union[Differences[#]]=={42}&]][[1]] (* Vincenzo Librandi, Jun 21 2015 *)
Comments