A295848 Number of nonnegative solutions to (x,y,z) = 1 and x^2 + y^2 + z^2 = n.
0, 3, 3, 1, 0, 6, 3, 0, 0, 3, 6, 3, 0, 6, 6, 0, 0, 9, 3, 3, 0, 6, 3, 0, 0, 6, 12, 3, 0, 12, 6, 0, 0, 6, 9, 6, 0, 6, 9, 0, 0, 15, 6, 3, 0, 6, 6, 0, 0, 6, 12, 6, 0, 12, 9, 0, 0, 6, 6, 9, 0, 12, 12, 0, 0, 18, 12, 3, 0, 12, 6, 0, 0, 9, 18, 6, 0, 12, 6, 0, 0, 9, 9, 9
Offset: 0
Examples
a(1) = 3; (1,0,0) = 1 and 1^2 + 0^2 + 0^2 = 1. (0,1,0) = 1 and 0^2 + 1^2 + 0^2 = 1. (0,0,1) = 1 and 0^2 + 0^2 + 1^2 = 1. a(2) = 3; (1,1,0) = 1 and 1^2 + 1^2 + 0^2 = 2. (1,0,1) = 1 and 1^2 + 0^2 + 1^2 = 2. (0,1,1) = 1 and 0^2 + 1^2 + 1^2 = 2. a(3) = 1; (1,1,1) = 1 and 1^2 + 1^2 + 1^2 = 3. a(5) = 6; (2,1,0) = 1 and 2^2 + 1^2 + 0^2 = 5. (2,0,1) = 1 and 2^2 + 0^2 + 1^2 = 5. (1,2,0) = 1 and 1^2 + 2^2 + 0^2 = 5. (1,0,2) = 1 and 1^2 + 0^2 + 2^2 = 5. (0,2,1) = 1 and 0^2 + 2^2 + 1^2 = 5. (0,1,2) = 1 and 0^2 + 1^2 + 2^2 = 5.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000 (n=0..200 from Seiichi Manyama)
Programs
-
Maple
N:= 100: V:= Array(0..N): for x from 0 to floor(sqrt(N/3)) do for y from x to floor(sqrt((N-x^2)/2)) do for z from y to floor(sqrt(N-x^2-y^2)) do if igcd(x,y,z) = 1 then r:= x^2 + y^2 + z^2; m:= nops({x,y,z}); if m=3 then V[r]:= V[r]+6 elif m=2 then V[r]:= V[r]+3 else V[r]:= V[r]+1 fi fi od od od: convert(V,list); # Robert Israel, Nov 30 2017
-
Mathematica
f[n_] := Total[ Length@ Permutations@# & /@ Select[ PowersRepresentations[n, 3, 2], GCD[#[[1]], #[[2]], #[[3]]] == 1 &]]; Array[f, 90, 0] (* Robert G. Wilson v, Nov 30 2017 *)
Comments