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-9 of 9 results.

A066527 Triangular numbers that for some k are also the sum of the first k primes.

Original entry on oeis.org

10, 28, 133386, 4218060, 54047322253, 14756071005948636, 600605016143706003, 41181981873797476176, 240580227206205322973571, 1350027226921161196478736
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 06 2002

Keywords

Comments

a(n) = A000217(i) = A007504(j) for appropriate i, j.
These are the 4, 7, 516, 2904, 328777, ... -th triangular numbers and are the sums of the first 3, 5, 217, 1065, 93448, ... prime numbers respectively.
a(7) is the sum of the first 240439822 primes. a(8) is the sum of the first 1894541497 primes. - Donovan Johnson, Nov 24 2008
a(9) is the sum of the first 132563927578 primes. a(10) is the sum of the first 309101198255 primes. a(11) > 6640510710493148698166596 (sum of first pi(2*10^13) primes). - Donovan Johnson, Aug 23 2010

Examples

			a(2) = 28, as A000217(7) = 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28 = 2 + 3 + 5 + 7 + 11 = A007504(5).
		

Crossrefs

Intersection of A000217 and A007504.
Cf. also A061890, A364691, A366269.

Programs

  • Haskell
    a066527 n = a066527_list !! (n-1)
    a066527_list = filter ((== 1) . a010054) a007504_list
    -- Reinhard Zumkeller, Mar 23 2013
    
  • Maple
    a066527(m) = local(d,ds,p,ps); d=1; ds=1; p=2; ps=2; while(ds
    				
  • Mathematica
    s = 0; Do[s = s + Prime[n]; t = Floor[ Sqrt[2*s]]; If[t*(t + 1) == 2s, Print[s]], {n, 1, 10^6} ]
    Select[Accumulate[Prime[Range[5000000]]],IntegerQ[(Sqrt[1+8#]-1)/2]&] (* Harvey P. Dale, May 04 2013 *)
  • Python
    from sympy import integer_nthroot, isprime, nextprime
    def istri(n): return integer_nthroot(8*n+1, 2)[1]
    def afind(limit):
        s, p = 2, 2
        while s < limit:
            if istri(s): print(s, end=", ")
            p = nextprime(p)
            s += p
    afind(10**11) # Michael S. Branicky, Oct 28 2021

Extensions

a(5) from Klaus Brockhaus and Robert G. Wilson v, Jan 07 2002
a(6) from Philip Sung (philip_sung(AT)hotmail.com), Jan 25 2002
a(7)-a(8) from Donovan Johnson, Nov 24 2008
a(9)-a(10) from Donovan Johnson, Aug 23 2010

A033997 Numbers n such that sum of first n primes is a square.

Original entry on oeis.org

9, 2474, 6694, 7785, 709838, 126789311423
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

Comments

Szabolcs Tengely asks if this sequence is infinite (see Lorentz Center paper). Luca shows that this sequence is of asymptotic density 0. Cilleruelo & Luca give a lower bound. - Charles R Greathouse IV, Feb 01 2013

Examples

			Sum of first 9 primes is 2+3+5+7+11+13+17+19+23 = 100, which is square, so 9 is in the sequence.
		

References

  • Florian Luca, On the sum of the first n primes being a square, Lithuanian Mathematical Journal 47:3 (2007), pp 243-247.

Crossrefs

Cf. A000040, A033998, A061888, A061890 (associated squares).
Cf. also A175133, A364696, A366270.

Programs

  • Mathematica
    p = 2; s = 0; lst = {}; While[p < 10^7, s = s + p; If[ IntegerQ@ Sqrt@ s, AppendTo[lst, PrimePi@ p]; Print@ lst]; p = NextPrime@ p] (* Zak Seidov, Apr 11 2011 *)
  • PARI
    n=0;s=0;forprime(p=2,1e6,n++;if(issquare(s+=p),print1(n", "))) \\ Charles R Greathouse IV, Feb 01 2013

Formula

a(n) = pi(A033998(n)).

Extensions

126789311423 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]

A033998 Numbers n such that the sum of the primes <= n is a square.

Original entry on oeis.org

23, 22073, 67187, 79427, 10729219, 3531577135439
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

Examples

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

Crossrefs

Programs

Formula

a(n) = Prime(A033997(n))

Extensions

3531577135439 from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007

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)).

A061888 Numbers k such that k^2 is the sum of the first m primes for some m.

Original entry on oeis.org

10, 5063, 14573, 17098, 1916357, 468726713734
Offset: 1

Views

Author

David W. Wilson, May 12 2001

Keywords

Examples

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

Crossrefs

Formula

a(n)^2 = A061890(n).

Extensions

a(6) from Giovanni Resta, May 27 2003
Edited by Ray Chandler, Mar 20 2007

A270424 Numbers m such that m^2 is the sum of the squares of two or more consecutive primes.

Original entry on oeis.org

586, 6088, 8174, 11585, 11707, 270106, 288818, 375661, 724909, 732910, 937423, 1141509, 1326970, 1619934, 1776809, 1930140, 2239367, 2489647, 3063687, 3649371, 3790381, 3941615, 4193988, 4821615, 4887146, 5572173, 6047246, 6192322, 8088524, 9158347
Offset: 1

Views

Author

Richard R. Forberg, Mar 30 2016

Keywords

Comments

m^2 = Sum_{i=k..j} prime(i)^2 is a square, for some k,j, j > k.
The 30 numbers given above are the only m values for all possible summations where the resulting m^2 < 10^14 (m <10^7). This requires searching from k values up to ~482,000, but with decreasing j-k ranges for efficiency.
Values of k that yield results begin: 13, 37, 101, 183, 235, 588, 805, 891, 1066, ... but do not correspond fully to the order of the m values shown.
Number of sequential summands (i.e., j-k+1) vary widely, with the smallest being 28 and largest being 10360, for those m values listed above.
Also note j-k+1 mod 8 = {0,1,4}, as expected, since prime(i)^2 mod 24 = 1, for i > 2.

Examples

			586 is in the sequence because 586^2 = 343396 = Sum_{i=13..40} prime(i)^2.
		

Crossrefs

Programs

  • Mathematica
    lim = 20000^2; L={}; P=Prime[Range[2 + PrimePi@ Sqrt[lim/2]]]^2; i = 1; While[ P[[i]] + P[[i+1]] <= lim, s = P[[i]]; j = i+1; While[(s += P[[j++]]) <= lim,If[IntegerQ@ Sqrt@ s, AppendTo[L, Sqrt@ s]]]; i++]; Union@L (* Giovanni Resta, Apr 13 2016 *)
    result = {}; k = 3; While[k <= 481167, resultk = {}; sump = 0;
    count = 0; i = k; While[sump < 10^14, sump += Prime[i]^2;
      If[Mod[i - k + 1, 8] == 1 || Mod[i - k + 1, 8] == 0 ||
        Mod[i - k + 1, 8] == 4, If[i != k && IntegerQ[Sqrt[sump]], count++;
        AppendTo[resultk, {k, i - k + 1, sump}]]]; i++];
    If[count > 0, AppendTo[result, resultk]]; k++]; result (* Only for k>2, so as to use index values to reduce repeated checking Sqrt - Richard R. Forberg, Apr 14 2016 *)

A274120 Squares that are the sum of the first k odd primes for some k.

Original entry on oeis.org

961, 1369, 1849, 4225, 263169, 130919364, 758451600, 29682949232484409
Offset: 1

Views

Author

K. D. Bajpai, Jun 10 2016

Keywords

Comments

Intersection of A000290 and A071148. [Felix Fröhlich, Jun 10 2016]
a(9), if it exists, is larger than 2*10^26 and would require adding more than 3.6*10^12 primes. - Giovanni Resta, Jun 12 2016

Examples

			961 is in the sequence because 961 = 31^2. Also, 3+5+7+...+83+89 = 961.
		

Crossrefs

Programs

  • Mathematica
    Select[s=0;Table[s=s+Prime[k],{k,2,15000000}],IntegerQ[Sqrt[#]]&]
    Select[Accumulate[Prime[Range[2,100000]]],IntegerQ[Sqrt[# ]]&] (* Harvey P. Dale, May 26 2023 *)
  • PARI
    my(s = 0); forprime(p=3, 1e10, s += p; if (issquare(s), print1(s, ", ")))

Extensions

Second comment rephrased by Harvey P. Dale, May 26 2023
Showing 1-9 of 9 results.