OFFSET
1,1
COMMENTS
Take groups of seven consecutive primes and sum terms {1st + 7th, 2nd + 6th, 3rd + 5th}. If these sums coincide, the middle term, i.e., the 4th one, is in the sequence.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..10000
EXAMPLE
3, 5, 7, [11], 13, 17, 19; Sums: {3 + 19, 5 + 17, 7 + 13} = {22, 22, 20}. Sums do not coincide, so 11 is not in the sequence.
43, 47, 53, [59], 61, 67, 71; Sums: {43 + 71, 47 + 67, 53 + 61} = {114, 114, 114}. Sums coincide, so 59 is in the sequence.
MAPLE
ss := []:
for n from 0 to 5000 do
pp := [seq(ithprime(n+i), i = 1 .. 7)];
if pp[1]+pp[7] = pp[2]+pp[6] = pp[3]+pp[5] then
ss := [op(ss), pp[4]];
end if;
end do:
ss := ss
MATHEMATICA
p = {2, 3, 5, 7, 11, 13, 17}; lst = {}; While[ p[[1]] < 25000, If[ p[[1]] + p[[7]] == p[[2]] + p[[6]] == p[[3]] + p[[5]], AppendTo[lst, p[[4]] ]]; p = Join[Rest@ p, {NextPrime@p[[-1]]}]]; lst (* Robert G. Wilson v, Jul 23 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
César Eliud Lozada, Jul 23 2017
STATUS
approved