OFFSET
1,1
COMMENTS
Equivalently, primes which are balanced primes of orders 1, 2, and 3. - Muniru A Asiru, Apr 08 2018
Numbers m such that A346399(m) is odd and >= 7. - Ya-Ping Lu, May 11 2024
LINKS
Jud McCranie, Table of n, a(n) for n = 1..1000
Wikipedia, Balanced prime
EXAMPLE
p = 683383: 683747 + ... + p + ... + 683819 = 7p; 683759 + ... + p + ... + 683807 = 5p; 683777 + p + 683789 = 3p.
MATHEMATICA
a = {}; Do[p = 2Prime[n]; If[p == Prime[n - 1] + Prime[n + 1], If[p == Prime[n - 2] + Prime[n + 2], If[p == Prime[n - 3] + Prime[n + 3], {n, 5, 1100000}] (* Robert G. Wilson v, Jun 28 2004 *)
Transpose[Select[Partition[Prime[Range[1620000]], 7, 1], (#[[1]]+#[[7]])/2 == (#[[2]]+#[[6]])/2==(#[[3]]+#[[5]])/2==#[[4]]&]][[4]] (* Harvey P. Dale, Sep 13 2013 *)
PROG
(GAP) P:=Filtered([1, 3..3*10^7+1], IsPrime);;
a:=Intersection(List([1, 2, 3], b->List(Filtered(List([0..Length(P)-(2*b+1)], k->List([1..2*b+1], j->P[j+k])), i->Sum(i)/(2*b+1)=i[b+1]), m->m[b+1]))); # Muniru A Asiru, Apr 08 2018
(Python)
from sympy import nextprime; p, q, r, s, t, u, v = 2, 3, 5, 7, 11, 13, 17
while v < 29000000:
if p + v == q + u == r + t == 2*s: print(s, end = ', ')
p, q, r, s, t, u, v = q, r, s, t, u, v, nextprime(v) # Ya-Ping Lu, May 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 02 2003
STATUS
approved