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.

A154587 Numbers that can be expressed both as the sum of first prime numbers and as the sum of first nonprime numbers.

This page as a plain text file.
%I A154587 #37 Mar 06 2018 11:16:20
%S A154587 0,5,28,71208,74139,9260197734,12374540078,7574780746329,
%T A154587 11101148723618,102581905748236,3325997869054417,
%U A154587 2886018916559052244845,46437379006448216748610,120197329614203475099994
%N A154587 Numbers that can be expressed both as the sum of first prime numbers and as the sum of first nonprime numbers.
%C A154587 Is this sequence finite?
%C A154587 Intersection of A007504 and A053767 generates A294174. - _R. J. Mathar_, Jan 17 2009
%C A154587 Heuristically, the sequence is infinite with about 2 sqrt(log x) members up to x. - _Charles R Greathouse IV_, Aug 14 2013
%H A154587 Giovanni Resta, <a href="/A154587/a154587.c.txt">C program</a>
%e A154587 5 = 2+3 = 1+4. 28 = 2+3+5+7+11 = 1+4+6+8+9.
%p A154587 P:=proc(q) local a,b,c,d,n; a:=0; b:=0; c:=0; d:=0; print(a);
%p A154587 for n from 1 to q do b:=nextprime(b); a:=a+b;
%p A154587 while c<a do d:=d+1; if not isprime(d) then c:=c+d; fi; od;
%p A154587 if c=a then print(a); fi; od; end: P(10^9);# _Paolo P. Lava_, Feb 23 2018
%t A154587 With[{p = Prime@ Range[10^7]}, {0}~Join~Intersection[Accumulate@ p, Accumulate@ Complement[Range@ Max@ p, p]]] (* _Michael De Vlieger_, Feb 25 2018 *)
%Y A154587 Intersection of A007504 and A051349. - _R. J. Mathar_, Jan 17 2009
%Y A154587 Cf. A133784, A294174.
%K A154587 nonn,more,nice
%O A154587 1,2
%A A154587 _Paolo P. Lava_ and _Giorgio Balzarotti_, Jan 15 2009
%E A154587 Corrected definition and a(6)-a(7) from _R. J. Mathar_, Jan 17 2009
%E A154587 a(8)-a(11) from _Donovan Johnson_, Feb 19 2009
%E A154587 a(12)-a(14) from _Giovanni Resta_, Aug 14 2013
%E A154587 Edited and a(1)=0 prepended by _Max Alekseyev_, Feb 10 2018