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.

Showing 1-3 of 3 results.

A294174 Numbers that can be expressed both as the sum of first primes and as the sum of first composites.

Original entry on oeis.org

0, 10, 1988, 14697, 83292, 1503397, 18859052, 93952013, 89171409882, 9646383703961, 209456854921713, 3950430820867201, 13113506646374409451778
Offset: 1

Views

Author

Max Alekseyev, Feb 10 2018

Keywords

Examples

			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)
		

Crossrefs

Intersection of A007504 and A053767.

Programs

  • 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 *)

A298270 Triangular numbers that for some k are also the sum of the first k composites.

Original entry on oeis.org

0, 10, 78, 153, 946, 177310, 450775, 13595505, 150988753, 4478601403, 5409300078, 5589152128, 76060335351, 248156250265, 1793751529485, 176149383165876, 187718592284301, 233626949305596, 11362376565228270, 18886935830647605, 1943937379018997076
Offset: 1

Views

Author

Altug Alkan, Feb 15 2018

Keywords

Examples

			10 is a term because 10 = 1 + 2 + 3 + 4 = 4 + 6.
		

Crossrefs

Intersection of A000217 and A053767.

Programs

  • Mathematica
    Join[{0},Select[Accumulate[Select[Range[10^6],CompositeQ]],OddQ[Sqrt[8#+1]]&]] (* The program generates the first 14 terms of the sequence. *) (* Harvey P. Dale, Apr 20 2024 *)
  • PARI
    lista(nn) = {my(s=0); forcomposite(n=0, nn, if(ispolygonal(s, 3), print1(s, ", ")); s += n; ); } \\ after Michel Marcus at A053767

A154588 Numbers that can be expressed as the sum of the first j integer numbers or the first k nonprime numbers, with j and k >=1.

Original entry on oeis.org

1, 28, 435, 10296, 415416, 1062153, 3703281, 426626655, 782002378, 102886232631, 1636197988776, 2749764593278, 61972139524851, 813577626225078, 1604393353172781, 3603538956517305, 44000970048906445, 83556903098276790, 208955344344897381
Offset: 1

Views

Author

Paolo P. Lava & Giorgio Balzarotti, Jan 16 2009, Jan 19 2009

Keywords

Comments

The indices (j,k) where A000217(j) = A051349(k) are (1,1), (7,5), (29,23), (143,123), (911,823), (1457,1327), (2721,2501), (29210,27488), (39547,37295) , (453621,433381) , (1808976,1737137) , (2345107,2253859) , (11133026,10746793), (40338012,39053670), (56646153,54880858) , (84894510,82314170) , (296651209,288273745), (408795555,397457085), (646460121,628975505). - Donovan Johnson, Sep 11 2009

Examples

			28 = A000217(7) = A051349(5).
435 = A000217(19) = A051349(23).
10296 = A000217(143) = A051349(123).
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=10^7,np},np=Select[Range[nn],!PrimeQ[#]&];Intersection[Accumulate[Range[ nn]],Accumulate[ np]]] (* The program generates the first 12 terms of the sequence. *) (* Harvey P. Dale, Feb 08 2024 *)

Formula

(A000217 INTERSECT A051349) MINUS {0}. - R. J. Mathar, Jan 21 2009

Extensions

10256 replaced with 10296 and two more terms added by R. J. Mathar, Jan 21 2009
Extended beyond a(9) by Donovan Johnson, Sep 11 2009
Showing 1-3 of 3 results.