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!)
A053790 Composite numbers arising as sum of first k primes. 4
10, 28, 58, 77, 100, 129, 160, 238, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888, 5117, 5350, 5589, 5830 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Generate sum of first k primes; accept if not prime.
LINKS
FORMULA
{k: A007504(k) in A002808}. - Michael S. Branicky, Oct 28 2021
EXAMPLE
a(4) = 77 because 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 = 77 = A007504(8) is composite, and 77 is the 4th such composite sum of k primes.
MAPLE
N:= 10^4: # to use primes <= N
P:= select(isprime, [2, seq(i, i=3..N, 2)]):
remove(isprime, ListTools:-PartialSums(P)); # Robert Israel, Sep 22 2016
MATHEMATICA
Cases[Accumulate[Prime[Range[100]]], Except[_?PrimeQ]] (*Fred Patrick Doty Aug 22 2017*)
PROG
(PARI) first(n)=my(v=vector(n), s, i); forprime(p=2, , if(isprime(s+=p), next); v[i++]=s; if(i==n, break)); v \\ Charles R Greathouse IV, Aug 23 2017
(Python)
from sympy import isprime, nextprime
def aupto(limit):
alst, s, p = [], 2, 2
while s < limit:
if not isprime(s): alst.append(s)
p = nextprime(p)
s += p
return alst
print(aupto(6000)) # Michael S. Branicky, Oct 28 2021
CROSSREFS
Intersection of A002808 and A007504.
Sequence in context: A088406 A169879 A054112 * A364694 A269441 A048491
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Mar 27 2000
STATUS
approved

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 August 11 01:05 EDT 2024. Contains 375059 sequences. (Running on oeis4.)