cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

2, 2, 3, 7, 13, 23, 47, 97, 193, 383, 769, 1531, 3067, 6133, 12269, 24533, 49069, 98129, 196247, 392503, 785017, 1570007, 3140041, 6280067, 12560147, 25120289, 50240587, 100481167, 200962327, 401924639, 803849303, 1607698583, 3215397193, 6430794373, 12861588749
Offset: 1

Views

Author

Joseph L. Pe, Mar 21 2002

Keywords

Examples

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

Programs

  • Maple
    A[1]:= 2: S:= 2:
    for n from 2 to 100 do
      A[n]:= prevprime(S+1);
      S:= S + A[n];
    od:
    seq(A[i],i=1..100); # Robert Israel, Jul 08 2020
  • Mathematica
    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 *)
  • 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, Jun 15 2004

Extensions

More terms from Rick L. Shepherd, Jun 15 2004