login
Number of ordered triples (w, x, y) with all terms in {1, ..., n} and w^2 + x^2 + y^2 < n.
3

%I #20 Jul 02 2023 09:35:22

%S 0,0,0,0,1,1,1,4,4,4,7,7,10,11,11,17,17,17,20,23,26,26,32,35,35,38,38,

%T 44,48,48,54,60,60,60,66,69,75,78,78,87,87,87,96,102,105,108,114,120,

%U 120,121,127,133,139,139,145,157,157,163,169,169,178,178,184

%N Number of ordered triples (w, x, y) with all terms in {1, ..., n} and w^2 + x^2 + y^2 < n.

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

%H David A. Corneth, <a href="/A211638/b211638.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) + A063691(n) = A211639(n). - _R. J. Mathar_, Jun 16 2023

%F a(n) = A211639(n-1). - _R. J. Mathar_, Jun 16 2023

%t t = Compile[{{n, _Integer}}, Module[{s = 0},

%t (Do[If[w^2 + x^2 + y^2 < n, s = s + 1],

%t {w, 1, #}, {x, 1, #}, {y, 1, #}] &[n]; s)]];

%t Map[t[#] &, Range[0, 80]] (* A211638 *)

%t (* _Peter J. C. Moses_, Apr 13 2012 *)

%o (PARI) first(n) = {n = max(n, 2); n-=2; my(res = vector(n), v = vector(n)); forvec(x = vector(3, i, [1,sqrtint(n)]), c = sum(i = 1, 3, x[i]^2); if(c <= n, v[c]++)); for(i = 2, #v, v[i]+=v[i-1]); concat([0,0],v)} \\ _David A. Corneth_, Jun 16 2023

%Y Cf. A211422.

%K nonn

%O 0,8

%A _Clark Kimberling_, Apr 18 2012