OFFSET
0,2
COMMENTS
Number of integer Cartesian grid points covered by a ring around the origin with width 1 and outer radius n + 1/2. - Ralf Stephan, Nov 28 2013
MATHEMATICA
a[n_] := If[n==0, 1, inf = (n-1/2)^2; sup = (n+1/2)^2; 4 Sum[Boole[inf < x^2 + y^2 < sup], {x, 0, n}, {y, 1, n}]];
a /@ Range[0, 49] (* Jean-François Alcover, Nov 14 2019 *)
PROG
(PARI) a(n)=sum(i=-n, n, sum(j=-n, n, d=sqrt(i*i+j*j); if(d>=n-1/2&&d<=n+1/2, 1))) \\ Ralf Stephan, Nov 28 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by Ralf Stephan, Nov 28 2013
STATUS
approved