login
Balanced primes of order three.
18

%I #39 Feb 13 2024 06:58:55

%S 17,53,157,173,193,229,349,439,607,659,701,709,977,1153,1187,1301,

%T 1619,2281,2287,2293,2671,2819,2843,3067,3313,3539,3673,3727,3833,

%U 4013,4051,4517,4951,5101,5897,6079,6203,6211,6323,6679,6869,7321,7589,7643,7907

%N Balanced primes of order three.

%C The arithmetic mean of 6 primes in its "neighborhood"; not to be confused with 'Triply balanced primes' (A081415).

%C A balanced prime of order three is not necessarily balanced of order one (A006562) or two (A082077), etc. [Typo corrected by _Zak Seidov_, Jul 23 2008]

%H Aaron Toponce, <a href="/A082078/b082078.txt">Table of n, a(n) for n = 1..1000</a>

%e p = 53 = (41 + 43 + 47 + 53 + 59 + 61 + 67)/7 = 371/7 i.e. it is the arithmetic mean.

%t Do[s3=Prime[n]+Prime[n+1]+Prime[n+2]; s5=Prime[n-1]+s3+Prime[n+3]; s7=Prime[n-2]+s5+Prime[n+4]; If[Equal[s7/7, Prime[n+1]], Print[Prime[n+1]]], {n, 3, 5000}]

%t (* Second program: *)

%t With[{k = 3}, Select[MapIndexed[{Prime[First@ #2 + k], #1} &, Mean /@ Partition[Prime@ Range[10^3], 2 k + 1, 1]], SameQ @@ # &][[All, 1]]] (* _Michael De Vlieger_, Feb 15 2018 *)

%t Select[Partition[Prime[Range[1500]],7,1],Mean[#]==#[[4]]&][[All,4]] (* _Harvey P. Dale_, Jul 01 2022 *)

%o (GAP) P:=Filtered([1..10000],IsPrime);;

%o a:=List(Filtered(List([0..1000],k->List([4..10],j->P[j-3+k])), i->

%o Sum(i)/7=i[4]),m->m[4]); # _Muniru A Asiru_, Feb 14 2018

%o (PARI) isok(p) = {if (isprime(p), k = primepi(p); if (k > 3, sum(i=k-3, k+3, prime(i)) == 7*p;););} \\ _Michel Marcus_, Mar 07 2018

%Y Cf. A006562, A082077, A082079, A096697, A096698, A096699, A096700, A096701, A096702, A096703, A096704.

%Y Cf. A096693, A082080, A081415, A051795, A006562.

%K nonn

%O 1,1

%A _Labos Elemer_, Apr 08 2003