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 11 results. Next

A024450 Sum of squares of the first n primes.

Original entry on oeis.org

4, 13, 38, 87, 208, 377, 666, 1027, 1556, 2397, 3358, 4727, 6408, 8257, 10466, 13275, 16756, 20477, 24966, 30007, 35336, 41577, 48466, 56387, 65796, 75997, 86606, 98055, 109936, 122705, 138834, 155995, 174764, 194085, 216286, 239087, 263736, 290305, 318194
Offset: 1

Views

Author

Keywords

Comments

It appears that the only square in this sequence is 4. Checked 10^11 terms. a(10^11) = 247754953701579144582110673365391267. - T. D. Noe, Sep 06 2005
a(2n-1) is divisible by 2, a(3n+1) is divisible by 3, a(4n-3) is divisible by 4, a(6n+1) is divisible by 6, a(8n-3) is divisible by 8, a(12n+1) is divisible by 12, a(24n-11) is divisible by 24. - Alexander Adamchuk, Jun 15 2006
The sequence is best looked at in base 12, with X for 10 and E for 11: 4, 11, 32, 73, 154, 275, 476, 717, X98, 1479, 1E3X, 289E, 3860, 4941, 6082, 7823, 9844, EX25, 12546, 15447, 18548, 20089, 2406X, 2876E, 320E0, 37E91, 42152, 488E3, 53754, 5E015, 68416, 76337, 85178, 94399, X51EX, E643E, 108760, 120001. Since the squares of all primes greater than 3 are always 1 mod 12, the sequence obeys the rule a(n) mod 12 = (n-1) mod 12 for n>=2. The rule gives a(2n-1) = (2n-2) mod 12 and so a(2n-1) must be divisible by 2. a(3n+1) = (3n) mod 12 so a(3n+1) is divisible by 3. The other rules are proved similarly. Remember: base 12 is a research tool! - Walter Kehowski, Jun 24 2006
For all primes p > 3, we have p^2 == 1 (mod m) for m dividing 24 (and only these m). Using a covering argument, it is not hard to show that all terms except a(24k+13) are nonsquares. Hence in the search for square a(n), only 1 out of every 24 terms needs to be checked. - T. D. Noe, Jan 23 2008

Crossrefs

Partial sums of A001248.
Cf. A007504 (sum of the first n primes).

Programs

  • Haskell
    a024450 n = a024450_list !! (n-1)
    a024450_list = scanl1 (+) a001248_list
    -- Reinhard Zumkeller, Jun 08 2015
    
  • Magma
    [&+[NthPrime(k)^2: k in [1..n]]: n in [1..40]]; // Vincenzo Librandi, Oct 11 2018
    
  • Magma
    [n le 1 select 4 else Self(n-1) + NthPrime(n)^2: n in [1..80]]; // G. C. Greubel, Jan 30 2025
    
  • Maple
    A024450:=n->add(ithprime(i)^2, i=1..n); seq(A024450(n), n=1..100); # Wesley Ivan Hurt, Nov 09 2013
  • Mathematica
    Table[ Sum[ Prime[k]^2, {k, 1, n} ], {n, 40} ]
    Accumulate[Prime[Range[40]]^2] (* Harvey P. Dale, Apr 16 2013 *)
  • PARI
    s=0;forprime(p=2,1e3,print1(s+=p^2", ")) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    a(n) = norml2(primes(n)); \\ Michel Marcus, Nov 26 2020
    
  • Python
    from sympy import prime, primerange
    def a(n): return sum(p*p for p in primerange(1, prime(n)+1))
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Apr 13 2021

Formula

a(n) = A007504(n)^2 - 2*A024447(n). - Alexander Adamchuk, Jun 15 2006
a(n) = Sum_{i=1..n} prime(i)^2. - Walter Kehowski, Jun 24 2006
a(n) = (1/3)*n^3*log(n)^2 + O(n^3*log(n)*log(log(n))). The proof is similar to proof for A007504(n) (see link of Shevelev). - Vladimir Shevelev, Aug 02 2013
a(n) = a(n-1) + prime(n)^2, with a(1) = 4. - G. C. Greubel, Jan 30 2025

A098562 Primes that are the sum of the squares of the first k primes for some k.

Original entry on oeis.org

13, 20477, 75997, 239087, 2210983, 3579761, 29194283, 40002073, 45448471, 55600481, 77290091, 108095623, 114986483, 155637463, 226226771, 302920139, 324657881, 519681709, 551321299, 618359839, 797005427, 944007487, 1039681147, 1124764853, 1923614047, 2135308631
Offset: 1

Views

Author

Rick L. Shepherd, Sep 14 2004

Keywords

Comments

These are the primes arising in A098561.

Examples

			From _K. D. Bajpai_, Dec 15 2014: (Start)
13 is in the sequence because the sum of the squares of the first 2 primes is 2^2 + 3^2 = 4 + 9 = 13, which is prime.
20477 is in the sequence because the sum of the squares of the first 18 primes is 2^2 + 3^2 + 5^2 + ... + 59^2 + 61^2 = 4 + 9 + 25 + ... + 3481 + 3721 = 20477, which is prime.
(End)
		

Crossrefs

Cf. A098561 (corresponding n), A024450 (sum of squares of primes), A066525 (sums of cubes of primes), A013918 (sums of primes).
Cf. A000040, A006567. - Jonathan Vos Post, Aug 13 2009

Programs

  • Mathematica
    Select[Table[Sum[Prime[k]^2, {k, 1, n}], {n, 1000}], PrimeQ]  (* K. D. Bajpai, Dec 15 2014 *)
  • PARI
    s=0; forprime(p=2, 1e6, t=s+=p^2; if(isprime(t), print1(t,", "))) \\ K. D. Bajpai, Dec 15 2014

Extensions

a(24)-a(26) from K. D. Bajpai, Dec 15 2014
a(42) in b-file corrected by Andrew Howroyd, Feb 28 2018

A098563 Numbers n such that the sum of the cubes of the first n primes is prime.

Original entry on oeis.org

4, 8, 38, 48, 98, 102, 118, 128, 130, 132, 156, 168, 172, 178, 180, 190, 202, 208, 308, 346, 358, 364, 424, 482, 540, 600, 602, 614, 646, 676, 722, 748, 768, 776, 782, 792, 838, 902, 1016, 1028, 1036, 1058, 1062, 1082, 1086, 1100, 1102, 1132, 1144, 1176
Offset: 1

Views

Author

Rick L. Shepherd, Sep 14 2004

Keywords

Comments

n must clearly be even.

Examples

			4 is a term as the sum of the cubes of the first four primes is 2^3 + 3^3 + 5^3 + 7^3 = 503, which is prime.
		

Crossrefs

Cf. A066525 (corresponding primes), A098561 (sums of squares of primes), A013916 (sums of primes), A098999 (sums of cubes of primes).

Programs

  • Maple
    with(numtheory): P:=proc(n) add(ithprime(k)^3, k=1..n): end:
    A098563 := proc(n)local m: option remember: if(n=0)then return 0: fi: m:=procname(n-1)+2: while true do if(isprime(P(m)))then return m:fi: m:=m+2:od: end:
    seq(A098563(n), n=1..50); # Nathaniel Johnston, Apr 21 2011
  • Mathematica
    Select[Range[1000], PrimeQ[Sum[Prime[i]^3, {i, #}]] &] (* Carl Najafi, Aug 22 2011 *)
  • PARI
    lista(nn) = {s = 0; ip = 0; forprime (p=1, nn, ip++; if (isprime(s+=p^3), print1(ip, ", ")););} \\ Michel Marcus, Aug 22 2015

A124225 Numbers n such that the sum of the first n primes is prime and the sum of the squares of the first n primes is also prime.

Original entry on oeis.org

2, 158, 192, 216, 356, 426, 548, 680, 1178, 1196, 1466, 1500, 1524, 2324, 2438, 2904, 2990, 3060, 3146, 3618, 3902, 4110, 4134, 4346, 4602, 5790, 5840, 6186, 6344, 6710, 6720, 6836, 6990, 7592, 7632, 7716, 7790, 7838, 8156, 8420, 8622, 8658, 8664, 9092
Offset: 1

Views

Author

Tanya Khovanova, Dec 13 2006

Keywords

Crossrefs

Intersection of A098561 (Numbers n such that the sum of the squares of the first n primes is prime) and A013916 (Numbers n such that the sum of the first n primes is prime).

Programs

Extensions

More terms from Bruno Berselli, Dec 28 2011
Definition rephrased by Harvey P. Dale, Aug 18 2020

A122209 Sum of squares of the first n^2 primes = A024450[n^2].

Original entry on oeis.org

4, 87, 1556, 13275, 65796, 239087, 710844, 1789395, 4083404, 8384727, 16156884, 29194283, 50363460, 82888311, 132264452, 204330315, 306450780, 450504551, 647579748, 913503459, 1262033828, 1725350295, 2318488092, 3072687971
Offset: 1

Views

Author

Alexander Adamchuk, Aug 25 2006

Keywords

Comments

Prime a(n) are listed in A122210[n] = {239087,29194283,13459558559,2330212120559,591302115428891,...}. Corresponding numbers n such that a(n) is a prime are listed in A122211[n] = {6,12,30,66,156,180,228,336,366,...}.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Prime[k]^2,{k,1,n^2}],{n,1,50}]
    Module[{nn=600,t},t=Accumulate[Prime[Range[nn]]^2];Table[t[[i]],{i,Range[ Floor[ Sqrt[nn]]]^2}]] (* Harvey P. Dale, Dec 21 2014 *)

Formula

a(n) = Sum[ Prime[k]^2, {k,1,n^2} ]. a(n) = A024450[n^2].

A122210 Primes in A122209[n].

Original entry on oeis.org

239087, 29194283, 13459558559, 2330212120559, 591302115428891, 1475383481009147, 6659290813076243, 78234869090622611, 134532153287171039, 1936272192837757871, 12491376574210826183, 25493310333833042507
Offset: 1

Views

Author

Alexander Adamchuk, Aug 26 2006

Keywords

Comments

Sum of squares of the first n^2 primes is A122209[n] = A024450[n^2] = {4,87,1556,13275,65796,239087,710844,1789395,4083404,8384727,16156884,29194283,...}. Corresponding numbers n such that A122209[n] is prime are listed in A122211[n] = {6,12,30,66,156,180,228,336,366,558,750,840,894,978,...}.

Crossrefs

Programs

  • Mathematica
    s=0;Do[p=Prime[n];k=Sqrt[n];s=s+p*p;If[PrimeQ[s]&&IntegerQ[k],Print[{k,n,s}]],{n,1,10^7}]

Formula

a(n) = A122209[ A122211(n) ] = A024450[ A122211(n)^2 ].

A122211 Numbers k such that the sum of squares of the first k^2 primes is a prime.

Original entry on oeis.org

6, 12, 30, 66, 156, 180, 228, 336, 366, 558, 750, 840, 894, 978, 1398, 1410, 1506, 1560, 1578, 1662, 1794, 1800, 1812, 1824, 1890, 1992, 2094, 2268, 2334, 2358, 2430, 2604, 2736, 2742, 2766, 2802, 2856, 2922, 3042, 3312, 3390, 3702, 3948, 3954, 3984, 4170, 4314
Offset: 1

Views

Author

Alexander Adamchuk, Aug 26 2006

Keywords

Comments

Corresponding primes A122209(a(n)) = A024450(a(n)^2) are listed in A122210(n) = {239087, 29194283, 13459558559, 2330212120559, ...}. All a(n) are of the form 6*m, where m = {1, 2, 5, 11, 26, 30, 38, 56, 61, 93, 125, 140, 149, 163, 233, 235, 251, 260, 263, 277, 299, 300, ...}. Because A122209(2*m-1) is an even number and A122209(3*m-1) == A122209(3*m+1) == 0 (mod 3) for m >= 1. [Edited by Jinyuan Wang, Mar 23 2020]

Crossrefs

Programs

  • Mathematica
    s=0;Do[p=Prime[n];k=Sqrt[n];s=s+p*p;If[PrimeQ[s]&&IntegerQ[k],Print[{k,n,s}]],{n,1,10^7}]

Formula

A122209(a(n)) = A024450(a(n)^2) = A122210(n).

Extensions

More terms from Jinyuan Wang, Mar 23 2020

A160358 Indices of primes in A133547, i.e., numbers n such that the sum of the squares of the first n odd primes is prime.

Original entry on oeis.org

3, 5, 9, 11, 23, 29, 63, 65, 71, 95, 141, 159, 161, 173, 179, 183, 209, 219, 255, 299, 323, 341, 365, 371, 389, 393, 453, 485, 521, 567, 579, 605, 623, 633, 635, 639, 677, 701, 711, 723, 725, 747, 785, 827, 867, 945, 981, 993, 999, 1001, 1013, 1035, 1037, 1041
Offset: 1

Views

Author

M. F. Hasler, May 18 2009

Keywords

Comments

All terms are necessarily odd. Thus one could also consider the sequence floor(a(n)/2) = (1,2,4,5,11,14,31,32,35,...). Other possible variations would be to list the index a(n)+1 of the largest prime in that sum, or, since this is always even, (a(n)+1)/2 = (2,3,5,6,12,15,32,33,36,...).

Crossrefs

Programs

  • PARI
    s=0; for( i=2,1999, isprime(s+=prime(i)^2) & print1(i-1,","))

Formula

A160359(n) = A133547(a(n)) = A024450(a(n)+1) - 4.

A140596 Squares nearest to and < terms in A098562.

Original entry on oeis.org

9, 20449, 75625, 238144, 2208196, 3579664, 29192409, 39992976, 45441081, 55591936, 77281681, 108076816, 114982729, 155625625, 226201600, 302899216, 324648324, 519657616, 551310400, 618317956, 796989361, 943964176, 1039675536
Offset: 1

Views

Author

Enoch Haga, May 17 2008

Keywords

Examples

			The first term of A098562 is 13, the prime sum of 2^2=4 and 3^2=9. The square just preceding 13 is 9, the first term of this sequence.
		

Crossrefs

Formula

a(n) = A048760(A098562(n)). - Jason Yuen, Sep 30 2024

A140597 Squares nearest to and > terms in A098562.

Original entry on oeis.org

16, 20736, 76176, 239121, 2211169, 3583449, 29203216, 40005625, 45454564, 55606849, 77299264, 108097609, 115004176, 155650576, 226231681, 302934025, 324684361, 519703209, 551357361, 618367689, 797045824, 944025625, 1039740025
Offset: 1

Views

Author

Enoch Haga, May 17 2008

Keywords

Examples

			The first term of A098562 is 13, the prime sum of 2^2 + 3^2, where 4+9=13. The square just exceeding 13 is 16, the first term of this sequence.
		

Crossrefs

Formula

a(n) = A048761(A098562(n)). - Jason Yuen, Sep 30 2024
Showing 1-10 of 11 results. Next