login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0
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, 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, 1, 1, 1, 1, 1, 5, 23, 37, 1, 3, 1, 35, 1, 13, 1, 13, 99, 11, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Table of n, a(n) for n=1..83.

EXAMPLE

There are no primes before prime(1) so a(1) = 1.

a(3) = 3 as prime(3) = 5, which is the arithmetic mean of the three consecutive primes {3, 5, 7}.

MAPLE

P:=proc(x) local i, k, n, ok, p, pp, pn, q, s;

for n from 1 to x do p:=ithprime(n); pp:=p; pn:=p; s:=p; q:=1; ok:=1;

for i from 1 to n-1 do pp:=prevprime(pp); pn:=nextprime(pn); s:=s+pp+pn; q:=q+2;

if p*q=s then print(q); ok:=0; break; fi; od; if ok=1 then print(1); fi;

od; end: P(100); # Paolo P. Lava, Oct 19 2017

PROG

(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)}

CROSSREFS

Cf. A006562, A034964, A122535, A293395.

Sequence in context: A102480 A157964 A140670 * A276651 A185587 A068845

Adjacent sequences:  A293679 A293680 A293681 * A293683 A293684 A293685

KEYWORD

nonn

AUTHOR

David A. Corneth, Oct 14 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 10:05 EDT 2019. Contains 328146 sequences. (Running on oeis4.)