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

A056893 Smallest prime with square excess of n.

Original entry on oeis.org

2, 3, 7, 13, 41, 31, 23, 89, 73, 59, 47, 61, 113, 239, 79, 97, 593, 139, 163, 461, 277, 191, 167, 193, 281, 251, 223, 317, 353, 991, 431, 761, 433, 563, 359, 397, 521, 479, 439, 569, 617, 571, 619, 773, 829, 887, 947, 673, 1493, 1571, 727, 1013, 953, 1279
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(4)=13 since 13=3^2+4, while 2, 3, 5, 7 and 11 have square excesses of 1, 2, 1, 3 and 3 respectively.
		

Crossrefs

Programs

  • Maple
    A056893 := proc(n)
        local p ;
        p :=2 ;
        while A053186(p) <> n do
            p := nextprime(p) ;
        end do:
        return p ;
    end proc: # R. J. Mathar, Jul 28 2013
  • PARI
    A056893(n)={
        local(p=2) ;
        while( A053186(p)!=n,
            p=nextprime(p+1)
        ) ;
        return(p)
    } /* R. J. Mathar, Jul 28 2013 */

Formula

a(n) =n+A056894(n).
a(n) = min{p in A000040: A053186(p) = n}. - R. J. Mathar, Jul 28 2013

A056896 Smallest prime which can be written as k^2 + n for k >= 0.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 17, 13, 11, 11, 13, 13, 23, 19, 17, 17, 19, 19, 29, 37, 23, 23, 73, 29, 107, 31, 29, 29, 31, 31, 41, 37, 43, 71, 37, 37, 47, 43, 41, 41, 43, 43, 53, 61, 47, 47, 73, 53, 59, 67, 53, 53, 79, 59, 137, 61, 59, 59, 61, 61, 71, 67, 73, 101, 67, 67, 149, 73, 71
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(8)=17 because 17=3^2+8.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; While[p = n + k^2; ! PrimeQ[p], k++]; p, {n, 100}] (* T. D. Noe, Apr 01 2011 *)

Formula

a(n) = A056897(n)+n = A056898(n)^2+n.
For p a prime: a(p)=p (and a(p-1)=p if p<>3).

Extensions

Example corrected by Harvey P. Dale, Apr 01 2011

A056897 Smallest square where a(n)+n is prime.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 9, 4, 1, 0, 1, 0, 9, 4, 1, 0, 1, 0, 9, 16, 1, 0, 49, 4, 81, 4, 1, 0, 1, 0, 9, 4, 9, 36, 1, 0, 9, 4, 1, 0, 1, 0, 9, 16, 1, 0, 25, 4, 9, 16, 1, 0, 25, 4, 81, 4, 1, 0, 1, 0, 9, 4, 9, 36, 1, 0, 81, 4, 1, 0, 1, 0, 9, 4, 25, 36, 1, 0, 9, 16, 1, 0, 25, 4, 81, 16, 1, 0, 49, 16, 9, 4, 9
Offset: 0

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(8)=9 since 9 is a square and 9+8=7 which is a prime
		

Crossrefs

Programs

  • Mathematica
    With[{sqs=Range[0,20]^2},Table[SelectFirst[sqs,PrimeQ[n+#]&],{n,100}]] (* The program uses the SelectFirst function from Mathematica version 10 *) (* Harvey P. Dale, May 07 2016 *)

Formula

a(n) =A056896(n)-n =A056898(n)^2

A056894 If the smallest prime with a square excess of n is p then a(n)=p-n.

Original entry on oeis.org

1, 1, 4, 9, 36, 25, 16, 81, 64, 49, 36, 49, 100, 225, 64, 81, 576, 121, 144, 441, 256, 169, 144, 169, 256, 225, 196, 289, 324, 961, 400, 729, 400, 529, 324, 361, 484, 441, 400, 529, 576, 529, 576, 729, 784, 841, 900, 625, 1444, 1521, 676, 961, 900, 1225, 784
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(4)=9 because the smallest prime with a square excess of 4 is 13 and 13-4=9
		

Crossrefs

Formula

a(n) = A056893(n) - n = A048760(A056893(n)) = A056895(n)^2

A056895 If the smallest prime with a square excess of n is p then a(n)^2 = p - n.

Original entry on oeis.org

1, 1, 2, 3, 6, 5, 4, 9, 8, 7, 6, 7, 10, 15, 8, 9, 24, 11, 12, 21, 16, 13, 12, 13, 16, 15, 14, 17, 18, 31, 20, 27, 20, 23, 18, 19, 22, 21, 20, 23, 24, 23, 24, 27, 28, 29, 30, 25, 38, 39, 26, 31, 30, 35, 28, 45, 34, 31, 42, 31, 34, 33, 32, 33, 36, 35, 34, 75, 40, 37, 36, 41, 48, 45
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Examples

			a(4)=3 because the smallest prime with a square excess of 4 is 13 and 13 - 4 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[p = 2; While[n != p - (r = Floor@Sqrt[p])^2, p = NextPrime[p]]; AppendTo[a, r], {n, 74}]; a (* Ivan Neretin, May 02 2019 *)
  • PARI
    a(n) = {my(p=2); while(n != p-sqrtint(p)^2, p = nextprime(p+1)); sqrtint(p - n);} \\ Michel Marcus, May 05 2019

Formula

a(n) = sqrt(A056893(n)-n) = A000196(A056893(n)) = sqrt(A056894(n)).
Showing 1-6 of 6 results.