OFFSET
0,2
COMMENTS
Note that gcd(0,m) = m for any m.
I would also like to get the sequences of the numbers of distinct sums i+j+k (also distinct products i*j*k) over all ordered triples (i,j,k) with |i| + |j| + |k| <= n; also over all ordered triples (i,j,k) with |i| + |j| + |k| <= n and gcd(i,j,k) <= 1.
Also the sequences of the numbers of distinct sums i+j+k (also distinct products i*j*k) over all ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0 and i + j + k = n; also over all ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0, i + j + k = n and gcd(i,j,k) <= 1.
Also the number of ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0, i + j + k = n and gcd(i,j,k) <= 1.
From Robert Price, Mar 05 2013: (Start)
The sequences that address the previous comments are:
Distinct sums i+j+k with or without the GCD qualifier results in a(n)=2n+1 (A005408).
Distinct products i*j*k without the GCD qualifier is given by A213207.
Distinct products i*j*k with the GCD qualifier is given by A213208.
With the restriction i,j,k >= 0 ...
Distinct sums or products equal to n is trivial and always equals one (A000012).
Distinct sums <= n results in a(n)=n (A001477).
Distinct products <= n without the GCD qualifier is given by A213213.
Distinct products <= n with the GCD qualifier is given by A213212.
Ordered triples with sum = n without the GCD qualifier is A000217(n+1).
Ordered triples with sum = n with the GCD qualifier is A048240.
Ordered triples with sum <= n without the GCD qualifier is A000292.
Ordered triples with sum <= n with the GCD qualifier is A048241. (End)
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: (3 + Sum_{k>=1} (moebius(k)*((1+x^k)/(1-x^k))^3))/(1-x). - Vladeta Jovovic, Nov 22 2004. [Sketch of proof: Let b(n) = number of ordered triples (i, j, k) with |i| + |j| + |k| = n and gcd(i, j, k) <= 1. Then a(n) = A100450(n) = partial sums of b(n) and Sum_{d divides n} b(d) = 4*n^2+2 = A005899(n) with g.f. ((1+x)/(1-x))^3.]
MAPLE
f:=proc(n) local i, j, k, t1, t2, t3; t1:=0; for i from -n to n do for j from -n to n do t2:=gcd(i, j); for k from -n to n do if abs(i) + abs(j) + abs(k) <= n then t3:=gcd(t2, k); if t3 <= 1 then t1:=t1+1; fi; fi; od: od: od: t1; end;
MATHEMATICA
f[n_] := Length[ Union[ Flatten[ Table[ If[ Abs[i] + Abs[j] + Abs[k] <= n && GCD[i, j, k] <= 1, {i, j, k}, {0, 0, 0}], {i, -n, n}, {j, -n, n}, {k, -n, n}], 2]]]; Table[ f[n], {n, 0, 40}] (* Robert G. Wilson v, Dec 14 2004 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 21 2004
STATUS
approved