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!)
A294174 Numbers that can be expressed both as the sum of first primes and as the sum of first composites. 2
0, 10, 1988, 14697, 83292, 1503397, 18859052, 93952013, 89171409882, 9646383703961, 209456854921713, 3950430820867201, 13113506646374409451778 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
From Jon E. Schoenfield, Feb 10 2018: (Start)
10 is in the sequence because prime(1) + prime(2) + prime(3) = 2 + 3 + 5 = 10 and composite(1) + composite(2) = 4 + 6 = 10 (where composite(i) is the i-th composite number).
1988 is in the sequence because Sum_{i=1..33} prime(i) = A007504(33) = Sum_{i=1..51} composite(i) = A053767(51) = 1988.
a(n) = A007504(j)
n j k = A053767(k)
== ======== ======== =================
1 0 0 0
2 3 2 10
3 33 51 1988
4 80 147 14697
5 175 361 83292
6 660 1582 1503397
7 2143 5699 18859052
8 4556 12821 93952013
9 118785 403341 89171409882
10 1131142 4229425 9646383703961
11 5012372 19786181 209456854921713
12 20840220 86192660 3950430820867201 (End)
MATHEMATICA
nextComposite[n_] := Block[{k = n + 1}, While[PrimeQ@k, k++]; k]; c = sc = 4; p = sp = 2; lst = {0}; While[p < 1000000000, If[ sc == sp, AppendTo[lst, sc]; c = nextComposite@c; sc += c]; While[ sp < sc, p = NextPrime@ p; sp += p]; While[ sc < sp, c = nextComposite@ c; sc += c]]; lst (* Robert G. Wilson v, Feb 11 2018 *)
Module[{pr=Accumulate[Prime[Range[5*10^7]]], co=Accumulate[Select[ Range[ 11*10^7], CompositeQ]]}, Join[ {0}, Intersection[pr, co]]] (* The program generates the first 12 terms of the sequence; to generate the 13th term increase the Range specifications substantially, but the program will take a long time to run. *) (* Harvey P. Dale, Sep 17 2019 *)
CROSSREFS
Intersection of A007504 and A053767.
Sequence in context: A261603 A346543 A245016 * A177359 A228294 A004821
KEYWORD
nonn,more,nice
AUTHOR
Max Alekseyev, Feb 10 2018
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 April 19 06:41 EDT 2024. Contains 371782 sequences. (Running on oeis4.)