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.

A089228 Numbers m such that 1 + Sum_{k=1..m} prime(k) is prime.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 19, 25, 29, 31, 49, 51, 57, 97, 99, 103, 109, 119, 123, 127, 163, 169, 179, 185, 195, 207, 209, 211, 213, 217, 221, 223, 233, 235, 239, 251, 261, 269, 273, 289, 295, 297, 303, 325, 329, 333, 347, 369, 371, 375, 409, 439, 449, 453, 455, 467
Offset: 1

Views

Author

Yalcin Aktar, Dec 10 2003

Keywords

Comments

Also numbers n such that the sum of the first n "primes", as defined in A008578, is prime. Analogous to A013916. - Robert G. Wilson v, May 19 2015
Integers k such that A007504(k) + 1 is prime. - Michel Marcus, Aug 10 2023

Examples

			25 is a term: 1 + Sum_{k=1..25} prime(k) = 1061 is prime.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if isprime(1+add(ithprime(k),k=1..n))=true then n else fi end: seq(a(n),n=1..600); # Emeric Deutsch, Jul 02 2005
    # alternative
    Primes:= select(isprime,[2,seq(2*i+1,i=1..10^5)]):
    PS:= ListTools:-PartialSums(Primes):
    select(t -> isprime(PS[t]+1), [$1..nops(PS)]); # Robert Israel, May 19 2015
  • Mathematica
    Position[1 + Accumulate@ Prime@ Range@ 600, A013916%20*)%20(*%20_Robert%20G.%20Wilson%20v">?(PrimeQ@# &)] // Flatten (* after Harvey P. Dale from A013916 *) (* _Robert G. Wilson v, May 19 2015 *)
  • PARI
    for(n=1,10^3,if(isprime(1+sum(i=1,n,prime(i))),print1(n,", "))) \\ Derek Orr, May 19 2015

Extensions

Corrected and extended by Emeric Deutsch, Jul 02 2005