login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A081738 a(n) = Sum_{2 <= p <= n, p prime} p^2. 3
0, 4, 13, 13, 38, 38, 87, 87, 87, 87, 208, 208, 377, 377, 377, 377, 666, 666, 1027, 1027, 1027, 1027, 1556, 1556, 1556, 1556, 1556, 1556, 2397, 2397, 3358, 3358, 3358, 3358, 3358, 3358, 4727, 4727, 4727, 4727, 6408, 6408, 8257, 8257, 8257, 8257, 10466, 10466 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MATHEMATICA
Table[Total[Prime[Range[PrimePi[n]]]^2], {n, 48}] (* Stefano Spezia, Aug 22 2022 *)
PROG
(PARI) a(n, j=2) = if(n <= 1, return(0)); my(r=sqrtint(n)); my(V=vector(r, k, n\k)); my(F(n, j)=(subst(bernpol(j+1), x, n+1) - subst(bernpol(j+1), x, 1)) / (j+1)); my(L=n\r-1); V=concat(V, vector(L, k, L-k+1)); my(T=vector(#V, k, F(V[k], j))); my(S=Map(matrix(#V, 2, x, y, if(y==1, V[x], T[x])))); forprime(p=2, r, my(sp=mapget(S, p-1), p2=p*p); for(k=1, #V, if(V[k] < p2, break); mapput(S, V[k], mapget(S, V[k]) - p^j*(mapget(S, V[k]\p) - sp)))); mapget(S, n)-1; \\ Daniel Suteu, Aug 21 2022
(PARI) a(n) = norml2(primes(primepi(n))); \\ Michel Marcus, Aug 22 2022
CROSSREFS
Sequence in context: A344512 A168401 A370644 * A232496 A239256 A043049
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 07 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 10 09:30 EDT 2024. Contains 375044 sequences. (Running on oeis4.)