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.

Previous Showing 11-20 of 46 results. Next

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

A055400 Cube excess: difference between n and largest cube <= n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, May 16 2000

Keywords

Examples

			a(12) = 4 because 2^3 <= 12 < 3^3 and 12 - 2^3 = 4.
		

Crossrefs

Programs

Formula

a(n) = n - A048762(n) = n - floor(n^(1/3))^3.
a(n) < 3*n^(2/3) for n > 0. - Charles R Greathouse IV, Sep 02 2015

A064784 Difference between n-th triangular number t(n) and the largest square <= t(n).

Original entry on oeis.org

0, 2, 2, 1, 6, 5, 3, 0, 9, 6, 2, 14, 10, 5, 20, 15, 9, 2, 21, 14, 6, 28, 20, 11, 1, 27, 17, 6, 35, 24, 12, 44, 32, 19, 5, 41, 27, 12, 51, 36, 20, 3, 46, 29, 11, 57, 39, 20, 0, 50, 30, 9, 62, 41, 19, 75, 53, 30, 6, 66, 42, 17, 80, 55, 29, 2, 69, 42, 14, 84, 56, 27, 100, 71, 41, 10, 87, 56
Offset: 1

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 20 2001

Keywords

Comments

The second differences of a(n) - (a(n)-a(n-1))-(a(n-1)-a(n-2)) - give 2, -2, -1, 6, -6, -1, -1, 12, -12, -1, 16, -16, -1 ... 82k+2, 82k-2, -1, 82k+6, 82k-6, -1, -1, 82k+12, 82k-12, -1, 82k+16, -82k-16, -1, 82k+20, -82k-20, -1, -1, 82k+26, -82k-26, -1, 82k+30, -82k-30, -1, -1, 82k+36, -82k-36, -1, 82k+40, -82k-40, -1, 82k+44, -82k-44, -1, -1, 82k+50, -82k-50, -1, 82k+54, -82k-54, -1, -1, 82k+60, -82k-60, -1, 82k+64, -82k-64, -1, -1, 82k+70, -82k-70, -1, 82k+74, -82k-74, -1, 82k+78, -82k-78, -1, -1, ...

Examples

			n = 5: A000217(5) = 28, largest square below that is 25, so a(5) = 28 - 25 = 3.
		

Crossrefs

Cf. A001108, A076816, A128549, A230038. Unique values are in A230044.

Programs

  • Maple
    seq(n*(n+1)/2-floor(sqrt(n*(n+1)/2))^2,n=0..100);
  • Mathematica
    f[n_]:=n*(n+1)/2-Floor[Sqrt[n*(n+1)/2]]^2; lst={}; Do[AppendTo[lst,f[n]],{n,0,6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 17 2010 *)
    #-Floor[Sqrt[#]]^2&/@Accumulate[Range[100]] (* Harvey P. Dale, Oct 15 2014 *)
  • PARI
    { default(realprecision, 100); for (n=1, 1000, t=n*(n + 1)/2; a=t - floor(sqrt(t))^2; write("b064784.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 25 2009
    
  • Python
    from math import isqrt
    def A064784(n): return (m:=n*(n+1)>>1)-isqrt(m)**2 # Chai Wah Wu, Jun 01 2024

Formula

a(n) = n*(n+1)/2 - floor(sqrt(n*(n+1)/2))^2.
a(n) = A053186(A000217(n)). - R. J. Mathar, Sep 10 2016
a(A001108(n)) = 0. - Hugo Pfoertner, Jun 01 2024

Extensions

Definition corrected by Harry J. Smith, Sep 25 2009
Terms corrected by Harry J. Smith, Sep 25 2009

A135932 Primes whose integer square root remainder is also prime.

Original entry on oeis.org

3, 7, 11, 19, 23, 41, 43, 47, 67, 71, 83, 103, 107, 113, 149, 151, 157, 163, 167, 199, 227, 263, 269, 331, 337, 347, 353, 419, 431, 443, 487, 491, 503, 521, 587, 593, 599, 607, 613, 617, 619, 683, 719, 787, 797, 821, 827, 907, 911, 919, 929, 937, 941, 947
Offset: 1

Views

Author

Harry J. Smith, Dec 07 2007

Keywords

Comments

The integer square root of an integer x >= 0 can be defined as floor(sqrt(x)) and the remainder of this as x - (floor(sqrt(x)))^2.

Crossrefs

Cf. A053186.

Programs

  • Maple
    filter:= proc(p) isprime(p) and isprime(p - floor(sqrt(p))^2) end proc:
    select(filter, [seq(i,i=3..10000,2)]); # Robert Israel, Apr 30 2025
  • Mathematica
    f[n_]:=n-(Floor[Sqrt[n]])^2;lst={};Do[p=Prime[n];If[PrimeQ[f[p]],AppendTo[lst,p]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 25 2010 *)
  • PARI
    { forprime(p=2, 2000, isr = sqrtint(p); Rem = p - isr*isr; if (isprime(Rem), print1(p, ",") ) ) }

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

A066857 Smallest number k such that n! - k is a square.

Original entry on oeis.org

0, 1, 2, 8, 20, 44, 140, 320, 476, 3584, 12311, 4604, 74879, 414119, 2071775, 5703551, 11551671, 45680444, 442548224, 1960632176, 2657058876, 24923993276, 130518272975, 1478154932316, 5446454455004, 38610655379975
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 21 2002

Keywords

Comments

Sequence is not monotonic: a(n) < a(n-1) for n = 12, 71, 90, 143, 145, 151, 172, 218, 257. - Zak Seidov, Jun 25 2013

Examples

			a(10) = 3628800 - 1904 * 1904 = 3628800 - 3625216 = 3584.
		

Crossrefs

Cf. A068869.

Programs

  • Mathematica
    Table[n! - Floor[Sqrt[n! ]]^2, {n, 1, 27}]
  • PARI
    a(n)=my(N=n!); N-sqrtint(N)^2 \\ Charles R Greathouse IV, Jun 25 2013

Formula

a(n) = A053186(n!) = n!-A048760(n!) = n!-floor(sqrt(n!))^2 = n!-A055226(n)^2.

Extensions

More terms from Vladeta Jovovic, Mar 21 2002
Edited by Robert G. Wilson v and N. J. A. Sloane, Mar 22 2002

A094765 a(n) = n + 2 * square excess of n.

Original entry on oeis.org

0, 1, 4, 7, 4, 7, 10, 13, 16, 9, 12, 15, 18, 21, 24, 27, 16, 19, 22, 25, 28, 31, 34, 37, 40, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Crossrefs

Programs

  • Maple
    seq(3*n - 2*floor(sqrt(n))^2, n=0..1000); # Robert Israel, Oct 23 2015
  • PARI
    a(n) = 3*n - 2*sqrtint(n)^2; \\ Michel Marcus, Oct 23 2015

Formula

a(n) = n + 2*A053186(n).
G.f.: 3*x/(1-x)^2 - (2/(1-x)) * Sum_{k>=1} (2*k-1)*x^(k^2). The sum is related to Jacobi theta functions. - Robert Israel, Oct 23 2015

A104492 Cube excess of the n-th prime.

Original entry on oeis.org

1, 2, 4, 6, 3, 5, 9, 11, 15, 2, 4, 10, 14, 16, 20, 26, 32, 34, 3, 7, 9, 15, 19, 25, 33, 37, 39, 43, 45, 49, 2, 6, 12, 14, 24, 26, 32, 38, 42, 48, 54, 56, 66, 68, 72, 74, 86, 7, 11, 13, 17, 23, 25, 35, 41, 47, 53, 55, 61, 65, 67, 77, 91, 95, 97, 101, 115, 121, 4, 6, 10, 16, 24, 30
Offset: 1

Views

Author

Jonathan Vos Post, Mar 10 2005

Keywords

Examples

			a(48) = 7 because the 48th prime is 223 and 223 - 6^3 = 7, while 223 - 7^3 = -120.
		

Crossrefs

Programs

Formula

a(n) = A055400(A000040(n)).
a(n) = prime(n) - floor(prime(n)^(1/3))^3. - Jon E. Schoenfield, Jan 17 2015

A384688 Runs of t in the range 0 <= t <= k and the same parity as k, for successive k >= 0.

Original entry on oeis.org

0, 1, 0, 2, 1, 3, 0, 2, 4, 1, 3, 5, 0, 2, 4, 6, 1, 3, 5, 7, 0, 2, 4, 6, 8, 1, 3, 5, 7, 9, 0, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 11, 0, 2, 4, 6, 8, 10, 12, 1, 3, 5, 7, 9, 11, 13, 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15, 0, 2, 4, 6, 8, 10, 12, 14, 16
Offset: 0

Views

Author

Kevin Ryde, Jun 07 2025

Keywords

Comments

The corresponding k is A055086(n), or k+1 = A000267(n).
A run is 0, 2, 4, ..., k when k even, or 1, 3, 5, ..., k when k odd, and has length floor(k/2) + 1.
Runs start at quarter squares n = A002620(k+1), with those beginning 0 at oblong numbers n = A002378(i) and those starting 1 at the squares n = (i+1)^2 (for i >= 0 in both cases).
Starts to differ from A025643 at n=109.

Examples

			Runs and their corresponding k = A055086(n) begin,
  n          = 0  1  2    4    6      9
  a(n)       = 0, 1, 0,2, 1,3, 0,2,4, 1,3,5, ...
  A055086(n) = 0, 1, 2,2, 3,3, 4,4,4, 5,5,5, ...
		

Crossrefs

Cf. A002620, A002378 (indices of 0's), A000290 (indices of 1's).

Programs

  • Mathematica
    ClearAll[a] a[n_Integer]:=Module[{s,r},s=Floor[Sqrt[n]]; r=n-s^2; If[rVincenzo Librandi, Jul 06 2025 *)
  • PARI
    a(n) = my(r,s=sqrtint(n,&r)); if(r
    				

Formula

a(n) = 2*r+1 if r < s or a(n) = 2*(r-s) otherwise, where square root and remainder n = s^2 + r being s=A000196(n), r=A053186(n).
a(n) = ceiling(A053186(4*n+1) / 2).
a(n) = A055086(n) - 2*A216607(n+1).
a(n) = 2*A055087(n) + A079813(n+1).

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
Previous Showing 11-20 of 46 results. Next