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.

A131590 Sum of the squares of the first 2^n primes.

This page as a plain text file.
%I A131590 #25 Feb 25 2025 21:36:27
%S A131590 4,13,87,1027,13275,155995,1789395,19523155,204330315,2081006083,
%T A131590 20605602003,199966727443,1908356153955,17942429101363,
%U A131590 166591116531123,1529578004981731,13917470067182067,125565110929591171,1124685106917162579,10009134886727192611
%N A131590 Sum of the squares of the first 2^n primes.
%H A131590 Amiram Eldar, <a href="/A131590/b131590.txt">Table of n, a(n) for n = 0..34</a> (terms 0..30 from Michael S. Branicky)
%F A131590 a(n) = A024450(2^n). - _Amiram Eldar_, Jul 06 2024
%e A131590 The sum of the squares of the first 2^2 primes is a(2) = 4 + 9 + 25 + 49 = 87.
%t A131590 Array[Total[Prime[Range[2^#]]^2]&,20,0] (* _James C. McMahon_, Feb 25 2025 *)
%o A131590 (PARI) sumprimesq(n,b) = { local(x,y,s,a); for(y=0,n, s=0; for(x=1,b^y, s+=prime(x)^2; ); print1(s","); ) }
%o A131590 (PARI) lista(pmax) = {my(s = 0, k = 0, pow = 1); forprime(p = 1, pmax, k++; s += p^2; if(k == pow, print1(s, ", "); pow *= 2));} \\ _Amiram Eldar_, Jul 06 2024
%o A131590 (Python)
%o A131590 from sympy import sieve, prime
%o A131590 def a(n): return sum(p*p for p in sieve.primerange(1, prime(2**n)+1))
%o A131590 print([a(n) for n in range(20)]) # _Michael S. Branicky_, Apr 13 2021
%Y A131590 Cf. A024450, A099825.
%K A131590 nonn
%O A131590 0,1
%A A131590 _Cino Hilliard_, Aug 30 2007
%E A131590 a(18) and beyond from _Michael S. Branicky_, Apr 13 2021