login
a(n) is the number of Gaussian integers z=a+bi satisfying |z|<=n, a>0, b>=0.
1

%I #31 Dec 20 2021 10:02:43

%S 0,1,3,7,12,20,28,37,49,63,79,94,110,132,153,177,199,225,252,282,314,

%T 343,379,413,448,490,530,572,613,657,705,750,802,852,906,963,1013,

%U 1073,1128,1194,1256,1315,1381,1447,1519,1590,1656

%N a(n) is the number of Gaussian integers z=a+bi satisfying |z|<=n, a>0, b>=0.

%H Seiichi Manyama, <a href="/A036698/b036698.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Ga#gaussians">Index entries for Gaussian integers and primes</a>

%F a(n) = A000603(n) - n - 1.

%F a(n) = n^2 * Pi/4 + O(n). - _Charles R Greathouse IV_, Apr 03 2013

%F a(n) = A014200(n^2). - _Seiichi Manyama_, Dec 20 2021

%o (C)

%o typedef unsigned long ulong;

%o ulong A036698(ulong i)

%o {

%o const ulong ring = i*i;

%o ulong result = 0;

%o for(ulong a = 1; a <= i; a++)

%o {

%o const ulong a2 = a*a;

%o for(ulong b = 0; b <= i; b++)

%o {

%o ulong z = a2 + b*b;

%o if ( ring >= z ) result++;

%o }

%o }

%o return result;

%o } /* _Oskar Wieland_, Apr 02 2013 */

%o (PARI) a(n)=my(n2=n^2);sum(a=1,n,sqrtint(n2-a^2)+1) \\ _Charles R Greathouse IV_, Apr 03 2013

%o (PARI) a(n) = sum(k=1, n^2, sumdiv(k, d, kronecker(-4, k/d))); \\ _Seiichi Manyama_, Dec 20 2021

%Y Cf. A000603, A014200.

%K nonn

%O 0,3

%A _Clark Kimberling_