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.

A211339 Number of integer pairs (x,y) such that 1 < x <= y <= n and x^2 + y^2 <= n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 19, 19, 20, 21, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 25, 25, 25, 26, 26, 26, 26, 27, 28, 29
Offset: 1

Views

Author

Clark Kimberling, Apr 08 2012

Keywords

Comments

Partial sums of A025426.
For a guide to related sequences, see A211266.

Crossrefs

Cf. A211266.

Programs

  • Mathematica
    a = 1; b = n; z1 = 120;
    t[n_] := t[n] = Flatten[Table[x^2 + y^2, {x, a, b - 1}, {y, x, b}]]
    c[n_, k_] := c[n, k] = Count[t[n], k]
    TableForm[Table[c[n, k], {n, 1, 10}, {k, 1, 2 n}]]
    Table[c[n, n], {n, 1, z1}]   (* A025426 *)
    c1[n_, m_] := c1[n, m] = Sum[c[n, k], {k, a, m}]
    Table[c1[n, n], {n, 1, z1}]  (* A211339 *)

Formula

a(n) = -1/2(-1 + floor(sqrt(n/2)))(floor(sqrt(n/2))) + Sum_{k=1..floor(sqrt(n/2))} floor(sqrt(n - k^2)). - Nicholas Stearns, Apr 03 2017