login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068524 a(1) = 2; for n > 1, a(n) = largest prime not exceeding a(1) + ... + a(n-1). 4

%I

%S 2,2,3,7,13,23,47,97,193,383,769,1531,3067,6133,12269,24533,49069,

%T 98129,196247,392503,785017,1570007,3140041,6280067,12560147,25120289,

%U 50240587,100481167,200962327,401924639,803849303,1607698583,3215397193

%N a(1) = 2; for n > 1, a(n) = largest prime not exceeding a(1) + ... + a(n-1).

%H Robert Israel, <a href="/A068524/b068524.txt">Table of n, a(n) for n = 1..2000</a>

%e a(4) = largest prime not exceeding a(3) + a(2) + a(1) = 3 + 2 + 2 = 7; so a(4) = 7.

%p A[1]:= 2: S:= 2:

%p for n from 2 to 100 do

%p A[n]:= prevprime(S+1);

%p S:= S + A[n];

%p od:

%p seq(A[i],i=1..100); # _Robert Israel_, Jul 08 2020

%t s={2};ss=2;Do[a=If[PrimeQ[ss], ss, Prime[PrimePi[ss]]];AppendTo[s, a];AddTo[ss, a], {i, 40}];A068524=s - _Zak Seidov_, Sep 10 2005

%o (PARI) /* Version 2.1.5 of PARI uses Pocklington-Lehmer to certify primality */ /* of a_n when 1 is used as the optional flag in isprime: isprime(a_n,1) */ {a1=2; a2=2; print1(a1,",",a2,","); s=a1+a2; for(n=3,40, a_n=precprime(s); if(isprime(a_n,1), print1(a_n,","); s=s+a_n, error("very unlikely event occurred: ",a_n, " is a strong pseudoprime to up to 10 randomly-chosen bases but is not prime")))} (Rick L. Shepherd)

%K nonn

%O 1,1

%A _Joseph L. Pe_, Mar 21 2002

%E More terms from _Rick L. Shepherd_, Jun 15 2004

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 April 18 15:54 EDT 2021. Contains 343089 sequences. (Running on oeis4.)