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!)
A090918 Beginning with 3, least prime, greater than the previous term, such that the arithmetic mean of first n terms is a prime. 2

%I #21 Dec 05 2013 19:56:44

%S 3,7,11,23,41,53,79,127,313,353,431,443,599,863,1049,1669,3643,3919,

%T 4177,4657,4861,5261,6449,6737,7057,8821,9013,9337,10513,11161,13309,

%U 13693,14449,14537,15137,15377,15439,15991,16231,16607,16889,17489

%N Beginning with 3, least prime, greater than the previous term, such that the arithmetic mean of first n terms is a prime.

%C Intersection of A090918 and A090919: 3, 7, 11, 23, 11161, 4197541. - Zak Seidov, Apr 05 2011

%H Zak Seidov, <a href="/A090918/b090918.txt">Table of n, a(n) for n = 1..2000</a>

%F a(n) = n*A090919(n) - (n-1)*A090919(n-1). - Vladimir Shevelev, Nov 24 2012

%t f[s_] := Block[{m = 1 + Length@ s, p = NextPrime@ s[[-1]], ss = Plus @@ s}, While[ !PrimeQ[(ss + p)/m], p = NextPrime@ p]; Append[s, p]]; Nest[f, {3}, 41] (* _Robert G. Wilson v_, Dec 15 2012 *)

%o (PARI) {terms=100; A090918=A090919=vector(terms); A090918[1]=A090919[1]=3; s=0; for(k=2,terms, s=s+A090918[k-1]; p=A090918[k-1]+1; until(isprime(p) && (denominator((s+p)/k)==1) && isprime((s+p)/k), p++); A090918[k]=p; A090919[k]=(s+p)/k; print1(A090918[k],",") ); A090918}

%Y Cf. A090940, A090941, A090919.

%K nonn

%O 1,1

%A _Amarnath Murthy_, Dec 16 2003

%E Corrected and extended by _Rick L. Shepherd_, Mar 08 2004

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 April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)