OFFSET
1,3
COMMENTS
For a guide to related sequences, see A211266.
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
MAPLE
N:= 100: # for a(1)..a(N)
V:= Vector(N):
for y from 1 to N-1 do
for x from 1 to y do
r:= x^2 + y^2;
if r > N^2 then break fi;
t:= ceil(sqrt(r));
V[t]:= V[t]+1
od od:
ListTools:-PartialSums(convert(V, list)); # Robert Israel, Jun 04 2019
MATHEMATICA
a = 1; b = n; z1 = 120;
t[n_] := t[n] = Flatten[Table[x^2 + y^2, {x, a, b - 1}, {y, x, b}]] (* 1<=x<=y<=n *)
c[n_, k_] := c[n, k] = Count[t[n], k]
TableForm[Table[c[n, k], {n, 1, 7}, {k, 1, n^2}]]
Table[c[n, n^2], {n, 1, z1}] (* A046080 *)
c1[n_, m_] := c1[n, m] = Sum[c[n, k], {k, a, m}]
Table[c1[n, n^2], {n, 1, z1/2}] (* A211340 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Apr 08 2012
STATUS
approved