OFFSET
1,1
COMMENTS
All terms = {1, 5} mod 6. - Muniru A Asiru, Aug 19 2017
EXAMPLE
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.
MAPLE
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
MATHEMATICA
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 *)
PROG
(Python)
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
(PARI) 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
(GAP)
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Emmanuel Antonio José García, Jan 05 2016
EXTENSIONS
More terms from Michel Marcus, Jan 05 2016
STATUS
approved