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-9 of 9 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

A120861 Fixed-k dispersion for Q = 8: Square array D(g,h) (g, h >= 1), read by ascending antidiagonals.

Original entry on oeis.org

1, 2, 7, 3, 12, 41, 4, 19, 70, 239, 5, 24, 111, 408, 1393, 6, 31, 140, 647, 2378, 8119, 8, 36, 181, 816, 3771, 13860, 47321, 9, 48, 210, 1055, 4756, 21979, 80782, 275807, 10, 53, 280, 1224, 6149, 27720, 128103, 470832, 1607521, 11, 60, 309, 1632, 7134
Offset: 1

Views

Author

Clark Kimberling, Jul 09 2006

Keywords

Comments

For each positive integer n, there exists a unique pair (j,k) of positive integers such that (j + k + 1)^2 - 4*k = 8*n^2; in fact, j(n) = A087056(n) and k(n) = A087059(n).
Suppose g >= 1 and let k = k(g). The numbers in row g of array D are among those n for which (j + k + 1)^2 - 4*k = 8*n^2 for some j; that is, k stays fixed and j and n vary - hence the name "fixed-k dispersion". (The fixed-j dispersion for Q = 8 is A120860.)
Every positive integer occurs exactly once in array D and every pair of rows are mutually interspersed. That is, beginning at the first term of any row having greater initial term than that of another row, all the following terms individually separate the individual terms of the other row.

Examples

			Northwest corner:
  1,  7,  41,  239, 1393,  8119,  47321, ...
  2, 12,  70,  408, 2378, 13860,  80782, ...
  3, 19, 111,  647, 3771, 21979, 128103, ...
  4, 24, 140,  816, 4756, 27720, 161564, ...
  5, 31, 181, 1055, 6149, 35839, 208885, ...
  6, 36, 210, 1224, 7134, 41580, 242346, ...
... [Edited by _Petros Hadjicostas_, Jul 07 2020]
		

Crossrefs

Cf. A087056, A087059, A120858, A120859, A120860, A120862, A120863, A336109 (first column), A002315 (first row), A001542 (2nd row), A253811 (3rd row).

Programs

  • PARI
    f(n) = 3*n + 2*sqrtint(2*n^2) + 2;
    unused(listus) = {my(v=vecsort(Vec(listus))); for (i=1, vecmax(v), if (!vecsearch(v, i), return (i)););};
    D(nb) = {my(m = matrix(nb, nb), t); my(listus = List); for (g=1, nb, if (g==1, t = 1, t = unused(listus)); m[g,1]=t; listput(listus, t); t = f(t); m[g,2]=t; listput(listus, t); for (h=3, nb, t = 6*m[g,h-1] - m[g,h-2]; m[g, h] = t; listput(listus, t););); m;}; \\ Michel Marcus, Jul 08 2020

Formula

Define f(n) = 3*n + 2*floor(n*sqrt(2)) + 2. Let D(g,h) be the term in row g and column h of the array to be defined:
D(1,1) = 1; D(1,2) = f(1); and D(1,h) = 6*D(1,h-1) - D(1,h-2) for h >= 3.
For arbitrary g >= 1, once row g is defined, define D(g+1,1) = least positive integer not in rows 1,2,...,g; D(g+1,2) = f(D(g+1,1)); and D(g+1,h) = 6*D(g+1,h-1) - D(g+1,h-2) for h >= 3. All rows after row 1 are thus inductively defined. [Corrected by Petros Hadjicostas, Jul 07 2020]

Extensions

Name edited by Petros Hadjicostas, Jul 07 2020

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]

A120860 Fixed-j dispersion for Q = 8: Square array D(g,h) (g, h >= 1), read by ascending antidiagonals.

Original entry on oeis.org

1, 2, 5, 3, 10, 29, 4, 17, 58, 169, 6, 22, 99, 338, 985, 7, 34, 128, 577, 1970, 5741, 8, 39, 198, 746, 3363, 11482, 33461, 9, 46, 227, 1154, 4348, 19601, 66922, 195025, 11, 51, 268, 1323, 6726, 25342, 114243, 390050, 1136689, 12, 63, 297, 1562, 7711
Offset: 1

Views

Author

Clark Kimberling, Jul 09 2006

Keywords

Comments

For each positive integer n, there exists a unique pair (j,k) of positive integers such that (j + k + 1)^2 - 4*k = 8*n^2; in fact, j(n) = A087056(n) and k(n) = A087059(n). Suppose g >= 1 and let j = j(g).
The numbers in row g of array D are among those n for which (j + k + 1)^2 - 4*k = 8*n^2 for some k; that is, j stays fixed and k and n vary - hence the name "fixed-j dispersion". (The fixed-k dispersion for Q = 8 is A120861.)
Every positive integer occurs exactly once in D and every pair of rows are mutually interspersed. That is, beginning at the first term of any row having greater initial term than that of another row, all the following terms individually separate the individual terms of the other row. Possibly, D is the dispersion of A098021.
From Petros Hadjicostas, Jul 08 2020: (Start)
It appears that the first column of the dispersion array D is A187968. That is, the first column of D consists of those positive integers m such that A187967(m) = 1; i.e., those m for which floor(sqrt(2)*m + 2*sqrt(2)) - floor(sqrt(2)*m) - floor(2*sqrt(2)) = 1.
Indeed, Clark Kimberling, the author of this sequence and of sequence A187968, conjectured that A187968 is the complement of A098021, and that A098021 is the complement of the first column of array D here. (End)

Examples

			Northwest corner:
  1,  5,  29,  169,  985,  5741,  33461,  195025, ...
  2, 10,  58,  338, 1970, 11482,  66922,  390050, ...
  3, 17,  99,  577, 3363, 19601, 114243,  665857, ...
  4, 22, 128,  746, 4348, 25342, 147704,  860882, ...
  6, 34, 198, 1154, 6726, 39202, 228486, 1331714, ...
  7, 39, 227, 1323, 7711, 44943, 261947, 1526739, ...
  ...
		

Crossrefs

Programs

  • PARI
    f(n) = 3*n + 2*sqrtint(2*n^2); \\ A098021
    unused(listus) = {my(v=vecsort(Vec(listus))); for (i=1, vecmax(v), if (!vecsearch(v, i), return (i)););};
    D(nb) = {my(m = matrix(nb, nb), t); my(listus = List); for (g=1, nb, if (g==1, t = 1, t = unused(listus)); m[g,1]=t; listput(listus, t); t = f(t); m[g,2]=t; listput(listus, t); for (h=3, nb, t = 6*m[g,h-1] - m[g,h-2]; m[g, h] = t; listput(listus, t););); m;}; \\ Michel Marcus, Jul 08 2020

Formula

Define f(n) = 3*n + 2*floor(n*2^(1/2)). Let D(g,h) be the term in row g and column h of the array to be defined:
D(1,1) = 1; D(1,2) = f(1); D(1,h) = 6*D(1,h-1) - D(1,h-2) for h >= 3.
For arbitrary g >= 1, once row g is defined, define D(g+1,1) = least positive integer not in rows 1, 2, ..., g; D(g+1,2) = f(D(g+1,1)); and D(g+1,h) = 6*D(g+1,h-1) - D(g+1,h-2) for h >= 3. All rows after row 1 are thus inductively defined. [Corrected by Petros Hadjicostas, Jul 07 2020]

Extensions

Name edited by Petros Hadjicostas, Jul 07 2020

A087055 Largest square number less than 2*n^2.

Original entry on oeis.org

1, 4, 16, 25, 49, 64, 81, 121, 144, 196, 225, 256, 324, 361, 441, 484, 576, 625, 676, 784, 841, 961, 1024, 1089, 1225, 1296, 1444, 1521, 1681, 1764, 1849, 2025, 2116, 2304, 2401, 2500, 2704, 2809, 3025, 3136, 3249, 3481, 3600, 3844, 3969, 4225, 4356, 4489
Offset: 1

Views

Author

Jens Voß, Aug 07 2003

Keywords

Examples

			a(10) = 196 because 196 is the largest square less than 2*10^2 = 200.
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[Sqrt[2n^2-1]],{n,100}]^2  (* Harvey P. Dale, Mar 26 2011 *)
  • PARI
    a(n) = sqrtint(2*n^2)^2; \\ Michel Marcus, Jul 08 2020

Formula

a(n) = A001951(n)^2 = floor(n*sqrt(2))^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

A121490 Rectangular array T by antidiagonals: T(n,k) = [y+1]^2-y^2, where y=n*sqrt(k) and [ ] denotes the floor function.

Original entry on oeis.org

3, 2, 5, 1, 1, 7, 5, 4, 7, 9, 4, 9, 9, 4, 11, 3, 5, 13, 1, 14, 13, 2, 1, 4, 17, 6, 9, 15, 1, 8, 10, 1, 21, 13, 2, 17, 7, 4, 1, 4, 19, 25, 22, 16, 19, 6, 13, 9, 9, 19, 16, 29, 4, 7, 21, 5, 9, 19, 16, 21, 9, 11, 33, 13, 25, 23, 4, 5, 10, 25, 25, 4, 30, 4, 37, 24, 14, 25, 3, 1, 1, 9, 31, 1, 18, 16
Offset: 1

Views

Author

Clark Kimberling, Aug 02 2006

Keywords

Comments

(Row 1)=A080883; (Column 1)=A005408 except for initial term; (Column 2)=A087059; (Column 3)=A120865; (Column 4)=A016813 except for initial term; (Column 5)=A120867; Columns 1,4,9,16,25,... are arithmetic sequences; (Main diagonal)=A121489.

Examples

			Northwest corner:
3 2 1 5 4
5 1 4 9 5
7 7 9 13 4
9 4 1 17 1
		

Formula

T(n,k) = [y+1]^2-y^2

A120872 a(n) is the value of k for row n of the fixed-k dispersion for Q = 8.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jul 10 2006

Keywords

Comments

This sequence results from A087059 by deleting duplicates.

Examples

			For each positive integer n, there is a unique pair (j,k) of positive integers such that (j + k + 1)^2 - 4*k = 8*n^2. This representation is used to define the fixed-k dispersion for Q=8, given by A120861, having northwest corner:
  1,  7,  41, 239, ...
  2, 12,  70, 408, ...
  3, 19, 111, 647, ...
  4, 24, 140, 816, ...
  ...
The pair (j,k) for each n, shown in the position occupied by n in the above array, is shown here:
  (1,2), (17,2),  (43,2),  (673,2), ...
  (4,1), (32,1), (196,1), (1152,1), ...
  (2,7), (46,7), (306,7), (1822,7), ...
  (7,4), (63,4), (391,4), (2303,4), ...
  ...
The fixed-k for row 1 is a(1) = 2;
the fixed-k for row 2 is a(2) = 1; etc.
(For example, (46 + 7 + 1)^2 - 4*7 = 8*19^2.)
		

Crossrefs

Programs

  • PARI
    f(n) = 3*n + 2*sqrtint(2*n^2) + 2;
    unused(listus) = {my(v=vecsort(Vec(listus))); for (i=1, vecmax(v), if (!vecsearch(v, i), return (i)); ); };
    D(nb) = {my(m = matrix(nb, nb), t); my(listus = List); for (g=1, nb, if (g==1, t = 1, t = unused(listus)); m[g, 1]=t; listput(listus, t); t = f(t); m[g, 2]=t; listput(listus, t); for (h=3, nb, t = 6*m[g, h-1] - m[g, h-2]; m[g, h] = t; listput(listus, t); ); ); m; }; \\ A120860
    q(n) = (1 + sqrtint(2*n^2))^2 - 2*n^2; \\ A087059
    lista(nn) = my(m=D(nn)); vector(nn, n, q(m[n, 1])); \\ Michel Marcus, Jul 10 2020

Extensions

More terms from Michel Marcus, Jul 10 2020
Showing 1-9 of 9 results.