A303112
Primes p such that (r-q)/(q-p) = 2 or 1/2, and p < q < r are three consecutive primes.
Original entry on oeis.org
2, 5, 7, 11, 13, 17, 37, 41, 67, 89, 97, 101, 103, 107, 191, 193, 223, 227, 277, 307, 311, 347, 389, 397, 449, 457, 461, 479, 487, 491, 503, 613, 641, 739, 757, 761, 821, 823, 853, 857, 877, 881, 907, 929, 991, 1087, 1091, 1231, 1277, 1297, 1301, 1423, 1427, 1439, 1447, 1453
Offset: 1
The first three consecutive primes are 2, 3 and 5, and (5-3)/(3-2)=2, so the first term is a(1)=2, that is, the first prime of (2,3,5).
The next three consecutive primes are 3, 5 and 7, and (7-5)/(5-3)=1, so the first prime of (3,5,7) is not in the list.
The next three consecutive primes are 5, 7 and 11, and (11-7)/(7-5)=2, so the second term is a(2)=5, that is, the first prime of (5,7,11).
The prime 13 is also in the list because (19-17)/(17-13)=1/2.
Cf.
A257762 (indices of primes with above ratio = 2).
-
b={};
Do[If[Abs[Log[2,(Prime[j+2]-Prime[j+1])/(Prime[j+1]-Prime[j])]]==1,AppendTo[b,Prime[j]]],{j,1,200}];
Print@b
Select[Partition[Prime[Range[250]],3,1],(#[[3]]-#[[2]])/(#[[2]]-#[[1]]) == 2||(#[[3]]-#[[2]])/(#[[2]]-#[[1]])==1/2&][[All,1]] (* Harvey P. Dale, Mar 14 2022 *)
-
isok(p) = my(q = nextprime(p+1), r = nextprime(q+1), f = (r-q)/(q-p)); (f == 2) || (f == 1/2);
forprime(p=2, 1000, if (isok(p), print1(p, ", "))); \\ Michel Marcus, Apr 23 2018
A373299
Numbers prime(k) such that prime(k) - prime(k-1) = prime(k+2) - prime(k+1).
Original entry on oeis.org
7, 11, 13, 17, 29, 41, 59, 79, 101, 103, 107, 113, 139, 163, 181, 193, 227, 257, 269, 311, 359, 379, 397, 419, 421, 439, 461, 487, 491, 547, 569, 577, 599, 691, 701, 709, 761, 811, 823, 857, 863, 881, 887, 919, 983, 1021, 1049, 1051, 1091, 1109, 1163
Offset: 1
7 is in the list because the prime previous to 7 is 5 and the next primes after 7 are 11 and 13, so we have 7 - 5 = 13 - 11 = 2.
-
P:= select(isprime,[seq(i,i=3..10^4,2)]):
G:= P[2..-1]-P[1..-2]: nG:= nops(G):
J:= select(t -> G[t-1]=G[t+1],[$2..nG-1]):
P[J]; # Robert Israel, May 31 2024
-
Select[Partition[Prime[Range[200]], 4, 1], #[[2]] - #[[1]] == #[[4]] - #[[3]] &][[;; , 2]] (* Amiram Eldar, May 31 2024 *)
-
from sympy import prime
def ok(k):
return prime(k)-prime(k-1) == prime(k+2)-prime(k+1)
print([prime(k) for k in range(2,200) if ok(k)])
-
from sympy import nextprime
from itertools import islice
def agen(): # generator of terms
p, q, r, s = [2, 3, 5, 7]
while True:
if q-p == s-r: yield q
p, q, r, s = q, r, s, nextprime(s)
print(list(islice(agen(), 60))) # Michael S. Branicky, May 31 2024
A064103
Primes p = p(k) such that p(k) + p(k+9) = p(k+1) + p(k+8) = p(k+2) + p(k+7) = p(k+3) + p(k+6) = p(k+4) + p(k+5).
Original entry on oeis.org
13, 139, 6091, 19843, 51787, 55793, 113143, 179029, 205157, 302551, 346361, 460949, 895799, 970447, 1150651, 1180847, 1697257, 1929553, 2334781, 2580631, 2797447, 3056561, 3086009, 3416717, 3598943, 4024667, 4026107, 4067123, 4077583, 4389503, 4541083, 4790503
Offset: 1
13 + 47 = 17 + 43 = 19 + 41 = 23 + 37 = 29 + 31.
-
a = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Do[ a = Delete[ a, 1 ]; a = Append[ a, Prime[ n ] ]; If[ a[ [ 1 ] ] + a[ [ 10 ] ] == a[ [ 2 ] ] + a[ [ 9 ] ] == a[ [ 3 ] ] + a[ [ 8 ] ] == a[ [ 4 ] ] + a[ [ 7 ] ] == a[ [ 5 ] ] + a[ [ 6 ] ], Print[ a[ [ 1 ] ] ] ], {n, 1, 3 10^5} ]
A064104
Primes p = p(k) such that p(k) + p(k+11) = p(k+1) + p(k+10) = p(k+2) + p(k+9) = p(k+3) + p(k+8) = p(k+4) + p(k+7) = p(k+5) + p(k+6).
Original entry on oeis.org
137, 55787, 113131, 179021, 895789, 1150649, 3086003, 4026103, 4077559, 8021753, 8750857, 12577063, 14355559, 19136527, 19412863, 20065961, 21865339, 22633141, 25880177, 30404971, 33926159, 38202173, 41905891, 42925699
Offset: 1
137 + 193 = 139 + 191 = 149 + 181 = 151 + 179 = 157 + 173 = 163 + 167.
-
a = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Do[ a = Delete[ a, 1 ]; a = Append[ a, Prime[ n ] ]; If[ a[ [ 1 ] ] + a[ [ 12 ] ] == a[ [ 2 ] ] + a[ [ 11 ] ] == a[ [ 3 ] ] + a[ [ 10 ] ] == a[ [ 4 ] ] + a[ [ 9 ] ] == a[ [ 5 ] ] + a[ [ 8 ] ] == a[ [ 6 ] ] + a[ [ 7 ] ], Print[ a[ [ 1 ] ] ] ], {n, 1, 10^6} ]
okQ[n_]:=Length[Union[Take[n,6]+Reverse[Take[n,-6]]]]==1; Transpose[ Select[Partition[Prime[Range[2700000]],12,1],okQ]][[1]] (* Harvey P. Dale, Apr 25 2011 *)
A266882
Primes p(n) such that p(n) + p(n+3) = p(n+1) + p(n+2) and p(n) + p(n+4) = p(n+2) + p(n+3).
Original entry on oeis.org
13, 37, 223, 1087, 1423, 1483, 2683, 4783, 6079, 7331, 7547, 11057, 12269, 12401, 12641, 17333, 19471, 20743, 21799, 23027, 27733, 28097, 29017, 29389, 30631, 30859, 33191, 33343, 33587, 33613, 35527, 36551, 42457, 44263, 45817, 48857, 49459, 54499, 55813, 57329, 58151, 59207
Offset: 1
Starting from 13, the five consecutive primes are 13, 17, 19, 23, 29; and they satisfy 13 + 23 = 17 + 19 and 13 + 29 = 23 + 19. So 13 is in the sequence.
-
K:=10^7+1;; # to get all terms <= K.
P:=Filtered([1,3..K],IsPrime);;
A:=[];; for n in [1..Length(P)-4] do if P[n]+P[n+3]=P[n+1]+P[n+2] and P[n]+P[n+4]=P[n+2]+P[n+3] then Add(A,P[n]); fi; od; A; # Muniru A Asiru, Aug 19 2017
-
for i from 1 to 10^5 do if ithprime(i)+ithprime(i+3) = ithprime(i+1)+ithprime(i+2) and ithprime(i)+ithprime(i+4) = ithprime(i+2)+ithprime(i+3) then print(ithprime(i)); fi; od; # Muniru A Asiru, Aug 19 2017
-
Prime@ Select[Range@ 6000, And[Prime@ # + Prime[# + 3] == Prime[# + 1] + Prime[# + 2], Prime@ # + Prime[# + 4] == Prime[# + 2] + Prime[# + 3]] &] (* Michael De Vlieger, Jan 05 2016 *)
-
lista(nn) = {for (n=1, nn, if ((prime(n) + prime(n+3) == prime(n+1) + prime(n+2)) && (prime(n) + prime(n+4) == prime(n+2) + prime(n+3)), print1(prime(n), ", ")););} \\ Michel Marcus, Jan 05 2016
-
from sympy import primerange
b, c, d, e = 2, 3, 5, 7
for p in primerange(11, 10**9):
a, b, c, d, e = b, c, d, e, p
if a + d == b + c and a + e == c + d:
print(a, end=', ')
Comments