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.

A257023 Number of terms in the quarter-sum representation of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 1, 2, 2, 3, 2, 3, 2, 1, 2, 2, 3, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 2, 3, 3, 1, 2, 2, 3, 2
Offset: 0

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares, of which the least term is the trace; see A257019.

Examples

			Quarter-square representations:
r(0) = 0, so a(0) = 1
r(3) = 2 + 1, so a(3) = 2
		

Crossrefs

Programs

  • Mathematica
    z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[200]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    Table[Length[r[n]], {n, 0, 3 z}] (* A257022 *)

A257020 Numbers whose quarter-square representation consists of three terms.

Original entry on oeis.org

15, 19, 23, 28, 33, 35, 39, 41, 45, 47, 52, 54, 59, 61, 63, 67, 69, 71, 75, 77, 79, 80, 84, 86, 88, 89, 93, 95, 97, 98, 103, 105, 107, 108, 113, 115, 117, 118, 120, 124, 126, 128, 129, 131, 135, 137, 139, 140, 142, 143, 147, 149, 151, 152, 154, 155, 159, 161
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares (see A257019).

Examples

			Quarter-square representations:
r(15) = 12 + 2 + 1, three terms; a(1) = 15
r(19) = 16 + 2 + 1, three terms; a(2) = 19
		

Crossrefs

Cf. A002620, A257019, A257021, A257023 (trace), A257024 (number of square in quarter-square representation).

Programs

  • Mathematica
    z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, 4 z}];(* A257023 *)
    Flatten[-1 + Position[u, 1]]; (* A002620 *)
    Flatten[-1 + Position[u, 2]]; (* A257019 *)
    Flatten[-1 + Position[u, 3]]; (* A257020 *)
    Flatten[-1 + Position[u, 4]]; (* A257021 *)

A257021 Numbers whose quarter-square representation consists of four terms.

Original entry on oeis.org

255, 271, 287, 304, 321, 339, 357, 376, 395, 399, 415, 419, 435, 439, 456, 460, 477, 481, 499, 503, 521, 525, 544, 548, 567, 571, 575, 591, 595, 599, 615, 619, 623, 640, 644, 648, 665, 669, 673, 691, 695, 699, 717, 721, 725, 744, 748, 752, 771, 775, 779, 799
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares (see A257019).

Examples

			Quarter-square representations:
r(255) = 240 + 12 + 2 + 1; four terms
r(6969) = 6889 + 72 + 6 + 2; four terms
		

Crossrefs

Programs

  • Mathematica
    z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, 4 z}];(* A257023 *)
    Flatten[-1 + Position[u, 1]]; (* A002620 *)
    Flatten[-1 + Position[u, 2]]; (* A257019 *)
    Flatten[-1 + Position[u, 3]]; (* A257020 *)
    Flatten[-1 + Position[u, 4]]; (* A257021 *)

A257024 Number of squares in the quarter-sum representation of n.

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 1, 2, 1, 2, 2, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 0, 1, 0, 1, 1, 2, 0, 1, 2, 1, 2, 2, 3, 1, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 2, 1, 2, 2
Offset: 0

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares; see A257019.

Examples

			Quarter-square representations:
r(5) = 4 + 1, so a(5) = 2;
r(11) = 9 + 2, so a(11) = 1;
r(35) = 30 + 4 + 1, so a(35) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; Take[g, 100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]]
    sq = Table[n^2, {n, 0, 1000}]; t = Table[r[n], {n, 0, z}]
    u = Table[Length[Intersection[r[n], sq]], {n, 0, 250}]

A257022 Trace of n in the quarter-sum representation of n.

Original entry on oeis.org

0, 1, 2, 1, 4, 1, 6, 1, 2, 9, 1, 2, 12, 1, 2, 1, 16, 1, 2, 1, 20, 1, 2, 1, 4, 25, 1, 2, 1, 4, 30, 1, 2, 1, 4, 1, 36, 1, 2, 1, 4, 1, 42, 1, 2, 1, 4, 1, 6, 49, 1, 2, 1, 4, 1, 6, 56, 1, 2, 1, 4, 1, 6, 1, 64, 1, 2, 1, 4, 1, 6, 1, 72, 1, 2, 1, 4, 1, 6, 1, 2, 81
Offset: 0

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares, of which the least term is the trace; see A257019.

Examples

			Quarter-square representations:
r(0) = 0, so a(0) = 0
r(1) = 1, so a(1) = 1
r(2) = 2, so a(2) = 2
r(3) = 2 + 1, so a(3) = 1
		

Crossrefs

Programs

  • Mathematica
    z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[200]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    Table[Last[r[n]], {n, 0, 3 z}] (* A257022 *)

A257056 Numbers k such that (# squares) < (# nonsquares) in the quarter-squares representation of k.

Original entry on oeis.org

2, 6, 8, 12, 14, 15, 20, 22, 23, 30, 32, 33, 42, 44, 45, 48, 56, 58, 59, 62, 63, 72, 74, 75, 78, 79, 80, 89, 90, 92, 93, 96, 97, 98, 108, 110, 112, 113, 116, 117, 118, 129, 132, 134, 135, 138, 139, 140, 143, 152, 156, 158, 159, 162, 163, 164, 167, 168, 177
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares; see A257019. The sequences A257056, A257057, A257058 partition the nonnegative integers.

Examples

			Quarter-square representations:
r(0) = 0
r(1) = 1
r(2) = 2, so that a(1) = 2
r(3) = 2 + 1
r(4) = 4
r(5) = 4 + 1
r(6) = 6, so that a(2) = 6
		

Crossrefs

Programs

  • Mathematica
    z = 400; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, z}]  (* A257023 *)
    v = Table[Length[Intersection[r[n], Table[n^2, {n, 0, 1000}]]], {n, 0, z}]  (* A257024 *)
    -1 + Select[Range[0, z], 2 v[[#]] < u[[#]] &]   (* A257056 *)
    -1 + Select[Range[0, z], 2 v[[#]] == u[[#]] &]  (* A257057 *)
    -1 + Select[Range[0, z], 2 v[[#]] > u[[#]] &]   (* A257058 *)

A257057 Numbers k such that (# squares) = (# nonsquares) in the quarter-squares representation of k.

Original entry on oeis.org

3, 7, 11, 13, 18, 21, 24, 27, 31, 34, 38, 43, 46, 51, 55, 57, 60, 66, 70, 73, 76, 83, 87, 91, 94, 99, 102, 106, 111, 114, 119, 123, 127, 133, 136, 141, 146, 150, 157, 160, 165, 171, 175, 181, 183, 186, 191, 198, 202, 208, 211, 214, 219, 227, 231, 237, 241
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares; see A257019. The sequences A257056, A257057, A257058 partition the nonnegative integers.

Examples

			Quarter-square representations:
r(0) = 0
r(1) = 1
r(2) = 2
r(3) = 2 + 1, so that a(1) = 3
		

Crossrefs

Programs

  • Mathematica
    z = 400; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, z}]  (* A257023 *)
    v = Table[Length[Intersection[r[n], Table[n^2, {n, 0, 1000}]]], {n, 0, z}]  (* A257024 *)
    -1 + Select[Range[0, z], 2 v[[#]] < u[[#]] &]   (* A257056 *)
    -1 + Select[Range[0, z], 2 v[[#]] == u[[#]] &]  (* A257057 *)
    -1 + Select[Range[0, z], 2 v[[#]] > u[[#]] &]   (* A257058 *)

A257058 Numbers k such that (# squares) > (# nonsquares) in the quarter-squares representation of k.

Original entry on oeis.org

0, 1, 4, 5, 9, 10, 16, 17, 19, 25, 26, 28, 29, 35, 36, 37, 39, 40, 41, 47, 49, 50, 52, 53, 54, 61, 64, 65, 67, 68, 69, 71, 77, 81, 82, 84, 85, 86, 88, 95, 100, 101, 103, 104, 105, 107, 109, 115, 120, 121, 122, 124, 125, 126, 128, 130, 131, 137, 142, 144, 145
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Every positive integer is a sum of at most four distinct quarter squares; see A257019. The sequences A257056, A257057, A257058 partition the nonnegative integers.

Examples

			Quarter-square representations:
r(0) = 0, so a(1) = 0
r(1) = 1, so a(2) = 1
r(2) = 2
r(3) = 2 + 1
r(4) = 4, so a(3) = 4
		

Crossrefs

Programs

  • Mathematica
    z = 400; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
    g = h[100]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, z}]  (* A257023 *)
    v = Table[Length[Intersection[r[n], Table[n^2, {n, 0, 1000}]]], {n, 0, z}]  (* A257024 *)
    -1 + Select[Range[0, z], 2 v[[#]] < u[[#]] &]   (* A257056 *)
    -1 + Select[Range[0, z], 2 v[[#]] == u[[#]] &]  (* A257057 *)
    -1 + Select[Range[0, z], 2 v[[#]] > u[[#]] &]   (* A257058 *)

A257018 Rectangular array read by columns: row i shows the numbers whose greedy quarter-squares representation consists of i terms, for i = 1, 2, 3, 4.

Original entry on oeis.org

0, 3, 15, 255, 1, 5, 19, 271, 2, 7, 23, 287, 4, 8, 28, 304, 6, 10, 33, 321, 9, 11, 35, 339, 12, 13, 39, 357, 16, 14, 41, 376, 20, 17, 45, 395, 25, 18, 47, 399, 30, 21, 52, 415, 36, 22, 54, 419, 42, 24, 59, 435, 49, 26, 61, 439, 56, 27, 63, 456, 64, 29, 67
Offset: 1

Views

Author

Clark Kimberling, Apr 15 2015

Keywords

Comments

Theorem: Every positive integer is a sum of at most four distinct quarter squares (proved at Math Overflow link). The greedy representation is found as follows. Let f(n) be the greatest quarter-square <= n, and apply r(n) = f(n) + r(n - f(n)) until reaching 0. The least term of r(n) is the trace of n, at A257022.

Examples

			The array:
0    1    2    4    6    9    12   ...
3    5    7    8    10   11   13   ...
15   19   23   28   33   35   39   ...
255  271  287  304  321  339  357  ...
Quarter-square representations:
r(0) = 0,
r(1) = 1,
r(2) = 2,
r(3) = 2 + 1,
r(15) = 12 + 2 + 1,
r(6969) = 6889 + 72 + 6 + 2.
		

Crossrefs

Cf. A257018 (quarter-square sums), A002620 (row 1, the quarter-squares ), A257019 (row 2), A257020 (row 3); A257021 (row 4), A257023 (number of terms).

Programs

  • Mathematica
    z = 200; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, z}];
    s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];
    h[1] = {1}; h[n_] := Join[h[n - 1], s[n]]; g = h[200]; r[0] = {0};
    r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];
    u = Table[Length[r[n]], {n, 0, 4 z}]  (* A257023 *)
    TableForm[Table[Take[Flatten[-1 + Position[u, k]], 10], {k, 1, 4}]]  (*A257018 array *)
    t = Table[Take[Flatten[-1 + Position[u, k]], 30], {k, 1, 4}];
    Flatten[Table[t[[i, j]], {j, 1, 30}, {i, 1, 4}]] (*A257018 sequence *)
Showing 1-9 of 9 results.