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

A087056 Difference between 2 * n^2 and the next smaller square number.

Original entry on oeis.org

1, 4, 2, 7, 1, 8, 17, 7, 18, 4, 17, 32, 14, 31, 9, 28, 2, 23, 46, 16, 41, 7, 34, 63, 25, 56, 14, 47, 1, 36, 73, 23, 62, 8, 49, 92, 34, 79, 17, 64, 113, 47, 98, 28, 81, 7, 62, 119, 41, 100, 18, 79, 142, 56, 121, 31, 98, 4, 73, 144, 46, 119, 17, 92, 169, 63, 142, 32, 113, 196, 82
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Comments

The difference x - y between the legs of primitive Pythagorean triangles x^2 + y^2 = z^2 with even y is D(n, m) = n^2 - m^2 - 2*n*m (see A249866 for the restrictions on n and m to have primitive triangles, which are not used here except for 1 < = m <= n-1). Here a(n) is for positive D values the smallest number in row n, namely D(n, floor(n/(1 + sqrt(2)))), for n >= 3. For the smallest value |D| for negative D in row n >= 2 see A087059. - Wolfdieter Lang, Jun 11 2015

Examples

			a(10) = 4 because the difference between 2*10^2 = 200 and the next smaller square number (196) is 4.
		

Crossrefs

Programs

  • PARI
    a(n) = 2*n^2 - sqrtint(2*n^2)^2; \\ Michel Marcus, Jul 08 2020

Formula

a(n) = 2*n^2 - A087055(n) = 2*n^2 - A001951(n)^2 = 2*n^2 - (floor[n*sqrt(2)])^2
a(n) = (n - f(n))^2 - 2*f(n)^2 with f(n) = floor(n/(1 + sqrt(2))), for n >= 1 (the values for n = 1, 2 have here been included). See comment above. - Wolfdieter Lang, Jun 11 2015

A087057 Smallest number whose square is larger than 2*n^2.

Original entry on oeis.org

2, 3, 5, 6, 8, 9, 10, 12, 13, 15, 16, 17, 19, 20, 22, 23, 25, 26, 27, 29, 30, 32, 33, 34, 36, 37, 39, 40, 42, 43, 44, 46, 47, 49, 50, 51, 53, 54, 56, 57, 58, 60, 61, 63, 64, 66, 67, 68, 70, 71, 73, 74, 75, 77, 78, 80, 81, 83, 84, 85, 87, 88, 90, 91, 92, 94, 95, 97, 98, 99, 101
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Comments

Integer solutions to the equation x=ceiling(r*floor(x/r)) where r=sqrt(2). - Benoit Cloitre, Feb 14 2004

Examples

			a(10) = 15 because the 15^2 = 225 is the smallest square number greater than 2*10^2 = 200.
Can be built by recursive removals:
start with 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
get a(1) := 2 and remove the 2nd term (= 4):
[2] _ 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...
get a(2) := 3 and remove the 3rd term (= 7):
[2, 3] _ 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, ...
get a(3) := 5 and remove the 5th term (= 11):
[2, 3, 5] _ 6, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, ...
get a(4) := 6 and remove the 6th term (= 14):
[2, 3, 5, 6] _ 8, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, ...
get a(5) := 8 and remove the 8th term (= 18):
[2, 3, 5, 6, 8] _ 9, 10, 12, 13, 15, 16, 17, 19, 20, 21, 22, 23, 24, ...
get a(6) = 9 and remove the 9th term (= 21), etc.
- _Reinhard Zumkeller_, Feb 04 2014
		

Crossrefs

Programs

  • Haskell
    a087057 n = a087057_list !! (n-1)
    a087057_list = f [2..] where
       f (x:xs) = x : f (us ++ vs) where (us, _ : vs) = splitAt (x - 1) xs
    -- Reinhard Zumkeller, Feb 04 2014
  • Mathematica
    Ceiling[Range[110]Sqrt[2]] (* Harvey P. Dale, Oct 30 2013 *)
  • PARI
    a(n)=ceil(n*sqrt(2)) \\ Charles R Greathouse IV, Oct 24 2011
    
  • PARI
    a(n)=sqrtint(2*n^2+sqrtint(8*n^2)+1) \\ Charles R Greathouse IV, Oct 24 2011
    

Formula

a(n) = 1 + A001951(n) = 1 + floor(n*sqrt(2)) = sqrt(A087058(n)).
a(n) = ceiling(n*sqrt(2)). - Vincenzo Librandi, Oct 22 2011

A087059 Difference between 2*n^2 and the next greater square number.

Original entry on oeis.org

2, 1, 7, 4, 14, 9, 2, 16, 7, 25, 14, 1, 23, 8, 34, 17, 47, 28, 7, 41, 18, 56, 31, 4, 46, 17, 63, 32, 82, 49, 14, 68, 31, 89, 50, 9, 71, 28, 94, 49, 2, 72, 23, 97, 46, 124, 71, 16, 98, 41, 127, 68, 7, 97, 34, 128, 63, 161, 94, 25, 127, 56, 162, 89, 14, 124, 47, 161, 82, 1, 119
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Comments

For n >= 2, a(n) is also the smallest absolute value of all negative values in row n of the triangle D(n, m) = n^2 - m^2 - 2*n*m, for 2 <= m + 1 <= n. The negative values in row n start with m = floor(n/(1 + sqrt(2))) + 1 = ceiling(n/(1 + sqrt(2))). See also a comment on A087056 for the smallest positive numbers in row n >= 3. - Wolfdieter Lang, Jun 11 2015

Examples

			a(10) = 25 because the difference between 2*10^2 = 200 and the next greater square number (225) is 25.
		

Crossrefs

Programs

  • Mathematica
    (Floor[Sqrt[#]]+1)^2-#&/@Table[2n^2,{n,80}] (* Harvey P. Dale, Jan 15 2023 *)
  • PARI
    a(n) = (1 + sqrtint(2*n^2))^2 - 2*n^2 \\ Michel Marcus, Jun 25 2013

Formula

a(n) = A087058(n) - 2*n^2 = A087057(n)^2 - 2*n^2 = (1 + A001951(n))^2 - 2*n^2 = (1 + floor(n*sqrt(2)))^2 - 2*n^2.
a(n) = 2*c(n)^2 - (n - c(n))^2, with c(n) := ceiling(n/(1 + sqrt(2))), n >= 1. - Wolfdieter Lang, Jun 11 2015

A087060 Difference between 2n^2 and the nearest square number.

Original entry on oeis.org

1, 1, 2, 4, 1, 8, 2, 7, 7, 4, 14, 1, 14, 8, 9, 17, 2, 23, 7, 16, 18, 7, 31, 4, 25, 17, 14, 32, 1, 36, 14, 23, 31, 8, 49, 9, 34, 28, 17, 49, 2, 47, 23, 28, 46, 7, 62, 16, 41, 41, 18, 68, 7, 56, 34, 31, 63, 4, 73, 25, 46, 56, 17, 89, 14, 63, 47, 32, 82, 1, 82, 36, 49, 73, 14, 103, 23, 68
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Comments

max(a(n)/n) approaches sqrt(2), and the indices of the maxima are apparently in A227792. - Ralf Stephan, Sep 23 2013

Examples

			a(10) = 4 because the difference between 2*10^2 = 200 and the nearest square number (196) is 4.
		

Crossrefs

Programs

  • Mathematica
    dnsn[n_]:=Module[{c=2n^2,a,b},a=Floor[Sqrt[c]]^2;b=Ceiling[Sqrt[c]]^2;Min[c-a,b-c]]; Array[dnsn,80] (* Harvey P. Dale, Jul 01 2017 *)

Formula

a(n) = min [A087056(n), A087059(n)] = min [2*n^2 - (floor[n*sqrt(2)])^2, (1 + floor[n*sqrt(2)])^2 - 2*n^2]

A087058 Smallest square number greater than 2*n^2.

Original entry on oeis.org

4, 9, 25, 36, 64, 81, 100, 144, 169, 225, 256, 289, 361, 400, 484, 529, 625, 676, 729, 841, 900, 1024, 1089, 1156, 1296, 1369, 1521, 1600, 1764, 1849, 1936, 2116, 2209, 2401, 2500, 2601, 2809, 2916, 3136, 3249, 3364, 3600, 3721, 3969, 4096, 4356, 4489
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Examples

			A087058(10) = 225 because 225 is the smallest square number greater than 2*10^2 = 200.
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Sqrt[2n^2]]^2,{n,50}] (* Harvey P. Dale, Jan 22 2015 *)

Formula

A087058(n) = A087057(n)^2 = (1 + A001951(n))^2 = (1 + floor[n*sqrt(2)])^2
Showing 1-5 of 5 results.