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

A056892 a(n) = square excess of the n-th prime.

Original entry on oeis.org

1, 2, 1, 3, 2, 4, 1, 3, 7, 4, 6, 1, 5, 7, 11, 4, 10, 12, 3, 7, 9, 15, 2, 8, 16, 1, 3, 7, 9, 13, 6, 10, 16, 18, 5, 7, 13, 19, 23, 4, 10, 12, 22, 24, 1, 3, 15, 27, 2, 4, 8, 14, 16, 26, 1, 7, 13, 15, 21, 25, 27, 4, 18, 22, 24, 28, 7, 13, 23, 25, 29, 35, 6, 12, 18, 22, 28, 36, 1, 9, 19, 21
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(5) = 2 since the 5th prime is 11 = 3^2 + 2.
From _M. F. Hasler_, Oct 19 2018: (Start)
Written as a table, starting a new row when a square is reached, the sequence reads:
  1, 2,    // = 2 - 1, 3 - 1 = {primes between 1^2 = 1 and 2^2 = 4} - 1
  1, 3,     // = 5 - 4, 7 - 4 = {primes between 2^2 = 4 and 3^2 = 9} - 4
  2, 4,      // = 11 - 9, 13 - 9 = {primes between 3^2 = 9 and 4^2 = 16} - 9
  1, 3, 7,    // = 17 - 16, 19 - 16, 23 - 16 = {primes between 16 and 25} - 16
  4, 6,        // = 29 - 25, 31 - 25 = {primes between 5^2 = 25 and 6^2 = 36} - 25
  1, 5, 7, 11,  // = {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49} - 36
  4, 10, 12,    // = {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64} - 49
  3, 7, 9, 15,  // = {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81} - 64
  2, 8, 16,     // = {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100} - 81
  etc. (End)
		

Crossrefs

When written as a table, row lengths are A014085, and row sums are A108314 - A014085 * A000290 = A320688.

Programs

Formula

a(n) = A053186(A000040(n)).
a(n) = A000040(n) - A000006(n)^2. - M. F. Hasler, Oct 04 2009

A106044 Difference between n-th prime and next larger perfect square.

Original entry on oeis.org

2, 1, 4, 2, 5, 3, 8, 6, 2, 7, 5, 12, 8, 6, 2, 11, 5, 3, 14, 10, 8, 2, 17, 11, 3, 20, 18, 14, 12, 8, 17, 13, 7, 5, 20, 18, 12, 6, 2, 23, 17, 15, 5, 3, 28, 26, 14, 2, 29, 27, 23, 17, 15, 5, 32, 26, 20, 18, 12, 8, 6, 31, 17, 13, 11, 7, 30, 24, 14, 12, 8, 2, 33, 27, 21, 17, 11, 3, 40, 32, 22
Offset: 1

Views

Author

Zak Seidov, May 06 2005

Keywords

Comments

Can be read as a table, since there are always several primes between two squares, although this is the yet unproved Legendre's conjecture, cf. A014085. Whenever a(n+1) > a(n), the n-th prime is the largest one below a given square and prime(n+1) is the smallest prime larger than that square. For n > 1, these are also the indices where the parity of the terms changes. - M. F. Hasler, Oct 19 2018

Examples

			From _M. F. Hasler_, Oct 19 2018: (Start)
Written as a table, starting a new row when a square is reached, the sequence reads:
  2, 1,  // 4 - {2, 3: primes between 1^2 = 1 and 2^2 = 4}
  4, 2,   // 9 - {5, 7: primes between 2^2 = 4 and 3^2 = 9}
  5, 3,    // 16 - {11, 13: primes between 3^2 = 9 and 4^2 = 16}
  8, 6, 2,  // 25 - {17, 19, 23: primes between 4^2 = 16 and 5^2 = 25}
  7, 5,      // 36 - {29, 31: primes between 5^2 = 25 and 6^2 = 36}
  12, 8, 6, 2,// 49 - {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49}
  11, 5, 3,    // 64 - {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64}
  14, 10, 8, 2, // 81 - {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81}
  17, 11, 3,     // 100 - {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100}
  etc. (End)
		

Crossrefs

Cf. A158038 (analog for cubes).
Read as a table, row lengths are A014085 (number of primes between squares).
Row sums are A014085 * A000290(.+1) - A108314.

Programs

Extensions

Edited by M. F. Hasler, Oct 19 2018

A139562 Sum of primes < n^2.

Original entry on oeis.org

0, 0, 5, 17, 41, 100, 160, 328, 501, 791, 1060, 1593, 2127, 2914, 3831, 4661, 6081, 7982, 9523, 11599, 13887, 16840, 20059, 23592, 26940, 32353, 37561, 42468, 48494, 55837, 62797, 70241, 80189, 89672, 100838, 111587, 124211, 136114, 148827
Offset: 0

Views

Author

Cino Hilliard, Jun 11 2008

Keywords

Comments

This is also the sum of primes <= n^2.
Pi(x) is the prime counting function or the number of primes <= x.
SumP(n) is the sum of primes <= n.
SumP(n) ~ Pi(n^2).
For large n, a(n) is closely approximated by Pi(n^4). E.g., for n = 55, SumP(55^2) = 605877 and Pi(55^4) = 611827 with error = 0.0098...
For n = 10^5, SumP(10) = 2220822432581729238 and Pi(10^20) = 2220819602560918840 with error = 0.0000012...

Examples

			For n = 3, n^2 = 9, the sum of primes <= 9 is 2+3+5+7 = 17 = a(3).
		

Crossrefs

First differences: A108314.

Programs

  • Mathematica
    Array[Sum[p,{p,Prime@Range@PrimePi[#^2-1]}]&,51,0]
    (* or *)
    Table[Total@Select[Range[n^2-1],PrimeQ],{n,0,50}] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • PARI
    a(n) = sum(k=1, n^2, k*isprime(k)); \\ Michel Marcus, Jul 27 2021
    
  • Python
    from sympy import primerange
    def a(n): return sum(p for p in primerange(1, n*n))
    print([a(n) for n in range(39)]) # Michael S. Branicky, Jul 29 2021

Formula

a(n) = A034387(n^2) for n >= 1. - Alois P. Heinz, Jul 30 2021

Extensions

a(16) corrected by Michael S. Branicky, Jul 29 2021

A320688 Sum of the square excess A056892 of the primes between two squares.

Original entry on oeis.org

3, 4, 6, 11, 10, 24, 26, 34, 26, 33, 50, 67, 72, 46, 70, 109, 96, 132, 122, 153, 132, 145, 174, 229, 208, 175, 194, 287, 232, 244, 338, 267, 276, 345, 374, 239, 392, 396, 424, 390, 484, 373, 514, 563, 618, 424, 654, 821, 442, 557, 890, 814, 668, 741, 580, 642, 990, 811, 982, 968, 772
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Consider the primes p1,...,pK between two squares n^2 and (n+1)^2, and take the sum of the differences: (p1 - n^2) + ... + (pK - n^2). Obviously this equals (sum of these primes) - (number of these primes) * n^2.

Crossrefs

Row sums of A056892, read as a table.

Programs

  • Maple
    R:= NULL: p:= 2: n:= 1: t:= 0:
    while n <= 100 do
        t:= t + p-n^2;
        p:= nextprime(p);
        if p > (n+1)^2 then
         R:= R, t; t:= 0; n:= n+1;
        fi:
    od:
    R; # Robert Israel, Dec 17 2024
  • PARI
    a(n,s=0)={forprime(p=n^2,(n+1)^2,s+=p-n^2);s}

Formula

a(n) = A108314(n) - A014085(n)*A000290(n), where A000290(n) = n^2.

A320687 Sum of differences of the larger square and primes between two squares.

Original entry on oeis.org

3, 6, 8, 16, 12, 28, 19, 34, 31, 72, 42, 58, 63, 70, 116, 122, 79, 90, 112, 134, 169, 170, 108, 212, 200, 196, 246, 226, 240, 244, 292, 318, 394, 276, 336, 418, 283, 528, 445, 582, 429, 392, 530, 416, 565, 506, 581, 634, 548, 554, 655, 866, 616, 676, 641, 714, 965, 710, 922, 968, 827
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Consider the primes p1,...,pK between two squares n^2 and (n+1)^2, and take the sum of the differences (listed as A106044): ((n+1)^2 - p1) + ... + ((n+1)^2 - pK).

Examples

			a(1) = 3 = 2 + 1, where {2, 1} = 4 - {2, 3: primes between 1^2 = 1 and 2^2 = 4}.
a(2) = 6 = 4 + 2, with {4, 2} = 9 - {5, 7: primes between 2^2 = 4 and 3^2 = 9}.
a(3) = 8 = sum of {5, 3} = 16 - {11, 13: primes between 3^2 = 9 and 4^2 = 16}.
a(4) = 16 = sum of {8, 6, 2} = 25 - {17, 19, 23: primes between 4^2 and 5^2 = 25}.
a(5) = 12 = sum of {7, 5} = 36 - {29, 31: primes between 5^2 = 25 and 6^2 = 36}.
		

Crossrefs

Equals A014085 * A000290(.+1) - A108314.
Row sums of A106044 read as a table.

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    V:= Vector(N):
    p:= 1;
    do
       p:= nextprime(p);
       n:= floor(sqrt(p));
       if n > N then break fi;
       V[n]:= V[n]+(n+1)^2-p;
    od:
    convert(V,list); # Robert Israel, Jun 17 2019
  • PARI
    a(n,s=0)={forprime(p=n^2,(n+=1)^2,s+=n^2-p);s}

Formula

a(n) = A014085(n)*A000290(n+1) - A108314(n), where A000290(n) = n^2.

A161348 Arithmetic mean of primes on square intervals such that the mean is an integer.

Original entry on oeis.org

6, 12, 30, 42, 346, 558, 651, 701, 870, 1477, 1725, 2973, 5407, 6643, 7840, 9487, 10703, 11549, 12201, 12890, 21469, 23573, 24154, 42637, 54037, 64771, 111893, 114603, 115924, 129977, 167689, 256517, 257543, 349849, 357033, 398781, 524919
Offset: 1

Views

Author

Daniel Tisdale, Jun 07 2009

Keywords

Comments

The corresponding n, when A108314(n)/A014085(n) is an integer, are 2,3,5,6,18 ... - Michel Marcus, Aug 31 2013

Crossrefs

Cf. A108314, A014085. [From R. J. Mathar, Jun 16 2009]

Extensions

More terms from R. J. Mathar, Jun 16 2009
Showing 1-6 of 6 results.