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.

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 *)