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.

A053790 Composite numbers arising as sum of first k primes.

This page as a plain text file.
%I A053790 #21 Oct 28 2021 09:59:18
%S A053790 10,28,58,77,100,129,160,238,328,381,440,501,568,639,712,791,874,963,
%T A053790 1060,1161,1264,1371,1480,1593,1720,1851,1988,2127,2276,2427,2584,
%U A053790 2747,2914,3087,3266,3447,3638,3831,4028,4227,4438,4661,4888,5117,5350,5589,5830
%N A053790 Composite numbers arising as sum of first k primes.
%C A053790 Generate sum of first k primes; accept if not prime.
%H A053790 Robert Israel, <a href="/A053790/b053790.txt">Table of n, a(n) for n = 1..10000</a>
%F A053790 {k: A007504(k) in A002808}. - _Michael S. Branicky_, Oct 28 2021
%e A053790 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.
%p A053790 N:= 10^4: # to use primes <= N
%p A053790 P:= select(isprime,[2,seq(i,i=3..N,2)]):
%p A053790 remove(isprime,ListTools:-PartialSums(P)); # _Robert Israel_, Sep 22 2016
%t A053790 Cases[Accumulate[Prime[Range[100]]],Except[_?PrimeQ]] (*_Fred Patrick Doty_ Aug 22 2017*)
%o A053790 (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
%o A053790 (Python)
%o A053790 from sympy import isprime, nextprime
%o A053790 def aupto(limit):
%o A053790     alst, s, p = [], 2, 2
%o A053790     while s < limit:
%o A053790         if not isprime(s): alst.append(s)
%o A053790         p = nextprime(p)
%o A053790         s += p
%o A053790     return alst
%o A053790 print(aupto(6000)) # _Michael S. Branicky_, Oct 28 2021
%Y A053790 Cf. A053789, A013918, A066527.
%Y A053790 Intersection of A002808 and A007504.
%K A053790 easy,nonn
%O A053790 1,1
%A A053790 _Enoch Haga_, Mar 27 2000