login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090940 a(n) = least odd prime distinct from earlier elements such that average of first n elements is prime. 6
3, 7, 5, 13, 37, 73, 23, 71, 29, 109, 103, 19, 41, 293, 59, 251, 683, 107, 31, 223, 67, 151, 523, 127, 227, 131, 347, 83, 137, 197, 139, 907, 163, 503, 173, 389, 179, 863, 743, 211, 2671, 271, 701, 281, 101, 277, 4507, 367, 661, 373, 883, 383, 2927, 431, 541, 433 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) is the smallest not yet used odd prime such that (a(1)+...+a(n))/n is prime.
Conjectured to include all odd prime numbers. - David W. Wilson, Nov 23 2012
LINKS
Zak Seidov and Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
(3+7)/2 = 5, (3+7+5+13)/4 = 7.
MAPLE
q:= proc(n) option remember; is(n<3) end:
a:= proc(n) option remember; local k, p;
if n=1 then 3 else for k while q(k) or
irem(s(n-1)+ithprime(k), n, 'p')>0 or not isprime(p)
do od; q(k):= true; ithprime(k) fi
end:
s:= proc(n) option remember; a(n) +`if`(n<2, 0, s(n-1)) end:
seq (a(n), n=1..100); # Alois P. Heinz, Nov 21 2012
MATHEMATICA
a = 3; s = {a}; sm = a; Do[Do[p = Prime[k]; If[FreeQ[s, p] && PrimeQ[(sm + p)/i], sm = sm + p; AppendTo[s, p]; Break[]], {k, 3, 1000000}], {i, 2, 1000}]; s (* Zak Seidov, Nov 21 2012 *)
CROSSREFS
Cf. A090941.
Sequence in context: A065283 A352670 A268261 * A090916 A342701 A184162
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Dec 29 2003
EXTENSIONS
Corrected and extended by Ray Chandler, Dec 31 2003
Definition corrected by David W. Wilson, Nov 23 2012
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 06:34 EDT 2024. Contains 371265 sequences. (Running on oeis4.)