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-10 of 12 results. Next

A061890 Squares that are the sum of initial primes.

Original entry on oeis.org

100, 25633969, 212372329, 292341604, 3672424151449, 219704732167875184222756
Offset: 1

Views

Author

David W. Wilson, May 12 2001

Keywords

Comments

The set of squares in A007504. - Zak Seidov, Oct 07 2015

Examples

			100 = 10^2 = 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23, so 100 is in the sequence.
		

Crossrefs

Programs

  • Maple
    N:= 10^7: # to use primes up to N
    P:= select(isprime, [2,seq(2*i+1, i=1..floor(N/2))]):
    S:= ListTools:-PartialSums(P):
    select(issqr,S); # Robert Israel, Feb 16 2015
  • Mathematica
    s[n_] := Sum[Prime[i], {i, 1, n}];t := Table[s[n], {n, 20000}];Select[t, IntegerQ[Sqrt[#]] &] (* Carlos Eduardo Olivieri, Feb 24 2015 *)
  • PARI
    lista() = {s = 0; forprime(p=2, ,s += p; if (issquare(s), print1(s, ", ")););} \\ Michel Marcus, Mar 10 2015

Formula

a(n) = A061888(n)^2.
Intersection of A000290 and A007504. - Zak Seidov, Oct 08 2015

Extensions

Corrected by Vladeta Jovovic, May 21 2001
a(6) from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007

A364691 Pentagonal numbers which are the sum of the first k primes, for some k >= 0.

Original entry on oeis.org

0, 5, 13490, 3299391550, 22042432252064127, 2387505511919644051, 680588297594638712735
Offset: 1

Views

Author

Paolo Xausa, Aug 03 2023

Keywords

Examples

			5 is a term because it's both a pentagonal number and the sum of the first two primes (2 + 3).
		

Crossrefs

Intersection of A000326 with A007504.

Programs

  • Mathematica
    A364691list[kmax_]:=Module[{p=0},Join[{0},Table[If[IntegerQ[(Sqrt[24(p+=Prime[k])+1]+1)/6],p,Nothing],{k,kmax}]]];A364691list[25000] (* Paolo Xausa, Oct 06 2023 *)
  • PARI
    ispenta(n) = my(s); issquare(24*n+1,&s)&&s%6==5;
    my(S=0); forprime (p=2, oo, S+=p; if (ispenta(S), print1(S,", "))) \\ Hugo Pfoertner, Aug 03 2023

Extensions

a(5)-a(7) from Hugo Pfoertner, Aug 04 2023

A364694 Polygonal numbers of order greater than 2 (A090466) which are the sum of the first k primes, for some k > 0.

Original entry on oeis.org

10, 28, 58, 100, 129, 160, 238, 328, 381, 501, 568, 639, 712, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 2127, 2276, 2427, 2584, 2914, 3087, 3447, 3831, 4227, 4438, 4888, 5350, 5589, 5830, 6081, 6601, 6870, 8275, 10191, 10887, 11599, 12339, 12718
Offset: 1

Views

Author

Paolo Xausa, Aug 03 2023

Keywords

Examples

			28 is a term because it's both a triangular number and the sum of the first 5 primes (2 + 3 + 5 + 7 + 11).
58 is a term because it's both an octagonal number and the sum of the first 7 primes (2 + 3 + 5 + 7 + 11 + 13 + 17).
		

Crossrefs

Intersection of A007504 with A090466.

Programs

  • Mathematica
    A364693Q[n_]:=With[{d=Divisors[2n]},Catch[For[i=3,iJianing Song in A090466 *)
    A364694list[kmax_]:=Select[Accumulate[Prime[Range[kmax]]],A364693Q];A364694list[100]

A053790 Composite numbers arising as sum of first k primes.

Original entry on oeis.org

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
Offset: 1

Views

Author

Enoch Haga, Mar 27 2000

Keywords

Comments

Generate sum of first k primes; accept if not prime.

Examples

			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.
		

Crossrefs

Intersection of A002808 and A007504.

Programs

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

Formula

{k: A007504(k) in A002808}. - Michael S. Branicky, Oct 28 2021

A175133 Sum of first a(n) consecutive primes gives a triangular number.

Original entry on oeis.org

3, 5, 217, 1065, 93448, 39545957, 240439822, 1894541497, 132563927578, 309101198255
Offset: 1

Views

Author

Ctibor O. Zizka, Feb 20 2010

Keywords

Comments

A007504(a(n)) = A000217(j) for some j.
Numbers k such that Sum_{i=1..k} prime(i) = j*(j+1)/2, where prime(i) is i-th prime, and j an integer.

Examples

			k=3 is a term: 2+3+5=10, and 10=4*5/2 is a triangular number, j=4.
k=5 is a term: 2+3+5+7+11=28, and 28=7*8/2 is a triangular number, j=7.
k=217 is a term: 2+3+...+1327=133386, and 133386=516*517/2 is a triangular number, j=516.
		

Crossrefs

Programs

  • PARI
    isok(n) = ispolygonal(sum(k=1, n, prime(k)), 3); \\ Michel Marcus, Oct 13 2018

Extensions

a(6)-a(10) from Nathaniel Johnston, May 10 2011 (a(7)-a(10) based on comments by Donovan Johnson)
Name, comment and example clarified by Ilya Gutkovskiy, Aug 07 2023

A366269 Hexagonal numbers which are the sum of the first k primes, for some k >= 0.

Original entry on oeis.org

0, 28, 54047322253, 14756071005948636, 600605016143706003, 41181981873797476176, 240580227206205322973571
Offset: 1

Views

Author

Paolo Xausa, Oct 06 2023

Keywords

Examples

			28 is a term because it's both a hexagonal number and the sum of the first five primes (2 + 3 + 5 + 7 + 11).
		

Crossrefs

Intersection of A000384 with A007504.
Subsequence of A066527.
Cf. A061890, A364691, A364694, A366270 (corresponding k values).

Programs

  • Mathematica
    A366269list[kmax_]:=Module[{p=0},Join[{0},Table[If[IntegerQ[(Sqrt[8(p+=Prime[k])+1]+1)/4],p,Nothing],{k,kmax}]]];A366269list[10^5]

Formula

a(n) = A007504(A366270(n)).

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

A364798 Triangular numbers that for some k >= 1 are also the sum of the first k noncomposite numbers (1 together with the primes).

Original entry on oeis.org

1, 3, 6, 78, 448516225, 448254714630193471
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 08 2023

Keywords

Comments

a(n) = A000217(i) = A014284(j) for appropriate i, j.

Examples

			78 is a term because 78 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = 1 + 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19.
		

Crossrefs

Intersection of A000217 and A014284.

Programs

  • Mathematica
    Select[Accumulate[Join[{1}, Prime[Range[10000]]]], IntegerQ[Sqrt[8 # + 1]] &]

Extensions

a(6) from Jinyuan Wang, Aug 09 2023

A364799 Triangular numbers that for some k >= 1 are also the sum of the first k odd primes.

Original entry on oeis.org

3, 15, 1236378, 1454365, 3541791, 104856921, 2677839153, 3656187921870, 3973810409128, 1448587865213374600, 36691639282445615088081
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 08 2023

Keywords

Comments

a(n) = A000217(i) = A071148(j) for appropriate i, j.

Examples

			15 is a term because 15 = 1 + 2 + 3 + 4 + 5 = 3 + 5 + 7.
		

Crossrefs

Intersection of A000217 and A071148.

Programs

  • Mathematica
    Select[Accumulate[Prime[Range[2, 1000000]]], IntegerQ[Sqrt[8 # + 1]] &]
  • PARI
    lista(nn) = my(s=0); forprime(p=3, nn, s+=p; if(ispolygonal(s, 3), print1(s, ", "))) \\ Jinyuan Wang, Aug 10 2023

Extensions

a(10) from Jinyuan Wang, Aug 10 2023
a(11) from Martin Ehrenstein, Aug 23 2023
Showing 1-10 of 12 results. Next