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.

A108314 Sum of primes p with n^2 < p < (n+1)^2.

Original entry on oeis.org

5, 12, 24, 59, 60, 168, 173, 290, 269, 533, 534, 787, 917, 830, 1420, 1901, 1541, 2076, 2288, 2953, 3219, 3533, 3348, 5413, 5208, 4907, 6026, 7343, 6960, 7444, 9948, 9483, 11166, 10749, 12624, 11903, 12713, 17724, 17155, 19590, 18975, 16249, 22702, 21859, 26943
Offset: 1

Views

Author

Giovanni Teofilatto, Jun 30 2005

Keywords

Examples

			a(2)=12 because between 4 and 9 there are two primes (5 and 7) with sum equal to 12.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) local s,j: s:=0: for j from n^2 to (n+1)^2 do if isprime(j)=true then s:=s+j else s:=s: fi od end: seq(a(n),n=1..50); # Emeric Deutsch, Jul 01 2005
  • Mathematica
    f[n_] := Plus @@ Prime[ Range[PrimePi[n^2] + 1, PrimePi[(n + 1)^2]]]; Table[ f[n], {n, 44}] (* Robert G. Wilson v, Jul 01 2005 *)
  • PARI
    A108314(n)={r=0;forprime(i=n^2+1,(n+1)^2-1,r=r+i);r} \\ Michael B. Porter, Oct 14 2009
    
  • Python
    from sympy import sieve
    def a(n): return sum(p for p in sieve.primerange(n**2, (n+1)**2))
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jul 29 2021

Extensions

Edited, corrected and extended by Emeric Deutsch, Robert G. Wilson v and Rick L. Shepherd, Jul 01 2005