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.

A293682 a(n) = least odd number k > 1 such that p = prime(n) is the middle of k consecutive primes which have arithmetic mean p, or 1 if no such k exists.

This page as a plain text file.
%I A293682 #17 Mar 01 2024 02:05:38
%S A293682 1,1,3,1,1,1,7,1,1,15,1,17,1,1,1,3,1,1,1,13,1,5,1,11,1,1,1,1,1,1,1,1,
%T A293682 37,1,51,17,3,1,1,3,33,1,1,7,1,1,3,1,67,7,1,1,1,1,3,3,1,1,1,5,1,1,1,1,
%U A293682 1,1,1,1,1,5,23,37,1,3,1,35,1,13,1,13,99,11,1
%N A293682 a(n) = least odd number k > 1 such that p = prime(n) is the middle of k consecutive primes which have arithmetic mean p, or 1 if no such k exists.
%e A293682 There are no primes before prime(1) so a(1) = 1.
%e A293682 a(3) = 3 as prime(3) = 5, which is the arithmetic mean of the three consecutive primes {3, 5, 7}.
%o A293682 (PARI) a(n) = {my(s = pprev = pnxt = p = prime(n), q=1); for(i=1, n-1, pprev = precprime(pprev - 1); pnxt = nextprime(pnxt + 1); s += (pprev + pnxt); q += 2; if(p * q == s, return(q))); return(1)}
%Y A293682 Cf. A006562, A034964, A122535, A293395.
%K A293682 nonn
%O A293682 1,3
%A A293682 _David A. Corneth_, Oct 14 2017