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

%I #13 Apr 07 2017 03:14:42

%S 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,

%T 12,12,13,13,13,14,14,14,15,16,16,16,16,17,17,17,17,17,19,19,20,21,21,

%U 21,21,21,22,22,22,23,23,23,23,25,25,25,26,26,26,26,27,28,29

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

%C Partial sums of A025426.

%C For a guide to related sequences, see A211266.

%F 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

%t a = 1; b = n; z1 = 120;

%t t[n_] := t[n] = Flatten[Table[x^2 + y^2, {x, a, b - 1}, {y, x, b}]]

%t c[n_, k_] := c[n, k] = Count[t[n], k]

%t TableForm[Table[c[n, k], {n, 1, 10}, {k, 1, 2 n}]]

%t Table[c[n, n], {n, 1, z1}] (* A025426 *)

%t c1[n_, m_] := c1[n, m] = Sum[c[n, k], {k, a, m}]

%t Table[c1[n, n], {n, 1, z1}] (* A211339 *)

%Y Cf. A211266.

%K nonn

%O 1,5

%A _Clark Kimberling_, Apr 08 2012