login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A295849 Number of nonnegative solutions to gcd(x,y,z) = 1 and x^2 + y^2 + z^2 <= n. 3

%I #32 Jul 07 2018 04:28:41

%S 0,3,6,7,7,13,16,16,16,19,25,28,28,34,40,40,40,49,52,55,55,61,64,64,

%T 64,70,82,85,85,97,103,103,103,109,118,124,124,130,139,139,139,154,

%U 160,163,163,169,175,175,175,181,193,199,199,211,220,220,220,226,232,241

%N Number of nonnegative solutions to gcd(x,y,z) = 1 and x^2 + y^2 + z^2 <= n.

%H Robert Israel, <a href="/A295849/b295849.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = a(n-1) + A295848(n) for n > 0.

%p N:= 100:

%p V:= Vector(N):

%p for x from 0 to floor(sqrt(N/3)) do

%p for y from x to floor(sqrt((N-x^2)/2)) do

%p for z from y to floor(sqrt(N-x^2-y^2)) do

%p if igcd(x,y,z) = 1 then

%p r:= x^2 + y^2 + z^2;

%p m:= nops({x,y,z});

%p if m=3 then V[r]:= V[r]+6

%p elif m=2 then V[r]:= V[r]+3

%p else V[r]:= V[r]+1

%p fi

%p fi

%p od od od:

%p 0,op(ListTools:-PartialSums(convert(V,list))); # _Robert Israel_, Nov 30 2017

%t a[n_] := Sum[Boole[GCD[i, j, k] == 1], {i, 0, Sqrt[n]}, {j, 0, Sqrt[n - i^2]}, {k, 0, Sqrt[n - i^2 - j^2]}];

%t Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Jul 07 2018, after _Andrew Howroyd_ *)

%o (PARI) a(n) = {sum(i=0, sqrtint(n), sum(j=0, sqrtint(n-i^2), sum(k=0, sqrtint(n-i^2-j^2), gcd([i, j, k]) == 1)))} \\ _Andrew Howroyd_, Dec 12 2017

%Y Cf. A000606, A048134, A295820, A295848.

%K nonn

%O 0,2

%A _Seiichi Manyama_, Nov 29 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)