cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A374576 a(n) is the smallest prime prime(k) such that prime(k-n) and prime(k+n) are balanced primes of order n.

This page as a plain text file.
%I A374576 #26 Aug 03 2024 11:47:24
%S A374576 7829,18713,211,19891,2381,63649,183971,11287,67957,2197697,345749,
%T A374576 1359913,2267827,543383,16705691,2667311,3369869,38094029,35605289,
%U A374576 3303059,26184253,44116757,4271017,35099179,44191919,296115661,86828801,169863823,991,163355419,10301623,115044443,240284293
%N A374576 a(n) is the smallest prime prime(k) such that prime(k-n) and prime(k+n) are balanced primes of order n.
%C A374576 a(n) is the least prime that is the start and end of sequences of 2*n+1 consecutive primes whose arithmetic means are their medians.
%H A374576 Ruud H.G. van Tol, <a href="/A374576/b374576.txt">Table of n, a(n) for n = 1..80</a>
%e A374576 a(3) = 211 because the 7 consecutive primes 179, 181, 191, 193, 197, 199, 211 ending at 211 have mean = median = 193 and the 7 consecutive primes 211, 223, 227, 229, 233, 239, 241 starting at 211 have mean = median = 229, and 211 is the first prime for which this works.
%p A374576 f:= proc(n)
%p A374576  local S,i;
%p A374576  S:= [seq](ithprime(i),i=1..4*n+1);
%p A374576  do
%p A374576    if convert(S[1..2*n+1],`+`) = (2*n+1)*S[n+1] and convert(S[2*n+1..4*n+1],`+`) = (2*n+1)*S[3*n+1] then
%p A374576    return S[2*n+1] fi;
%p A374576    S:= [op(S[2..-1]),nextprime(S[-1])]
%p A374576  od;
%p A374576 end proc:
%p A374576 map(f, [$1..35]);
%o A374576 (PARI) alist(N) = {my(r=vector(N), p=primes(4*N+1), t); while(t=Vec(select(x->!x, r, 1)), foreach(t, n, my(w=2*n+1); if(vecsum(p[1..w])==w*p[1+n] && vecsum(p[w..2*w-1])==w*p[w+n], r[n]=p[w])); p=primes([p[2], nextprime(p[#p]+1)])); r;} \\ _Ruud H.G. van Tol_, Jul 13 2024
%Y A374576 Cf. A082080, A374507.
%K A374576 nonn
%O A374576 1,1
%A A374576 _Robert Israel_, Jul 11 2024