%I #29 Dec 05 2013 19:56:44
%S 3,5,7,11,17,23,31,43,73,101,131,157,191,239,293,379,571,757,937,1123,
%T 1301,1481,1697,1907,2113,2371,2617,2857,3121,3389,3709,4021,4337,
%U 4637,4937,5227,5503,5779,6047,6311,6569,6829,7079,7349,7639,7927,8263,8599
%N Primes arising as the arithmetic mean of first n terms of A090918.
%C a(1000) = 13918649. - _Rick L. Shepherd_, Mar 08 2004
%C Intersection of A090918 and A090919: 3,7,11,23,11161,4197541. - Zak Seidov, Apr 05 2011.
%C Contribution by Vladimir Shevelev, Nov 24 2012 (Start)
%C A recursive algorithm of parallel calculation of A090918 and A090919.
%C Together with a(n)=A090919(n), denote b(n)=A090918(n). We begin with a(1)=b(1)=3; if, for n>=2, we know a(n-1) and b(n-1), then a(n) is the smallest prime x such that n*x-(n-1)*a(n-1) is a prime greater than b(n-1). Now, knowing a(n), we have b(n) = n*a(n) - (n-1)*a(n-1).
%C For example, suppose that we know that a(5)=17, b(5)=41. To find a(6) and b(6), consider inequality 6*x - 5*17 > 41, where x is prime. Thus we consider x >= 23. Since, already for x=23, 6*x-5*17=53 is prime, then a(6)=23, b(6)=53. (End)
%H Zak Seidov, <a href="/A090919/b090919.txt">Table n, a(n) for n=1..2000</a>
%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]]; s = Nest[f, {3}, 41]; (Accumulate@ s)/Range@ 42 (* _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(A090919[k],",") ); A090919}
%Y Cf. A090940, A090941, A090918.
%K nonn
%O 1,1
%A _Amarnath Murthy_, Dec 16 2003
%E Corrected and extended by _Rick L. Shepherd_, Mar 08 2004