This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A281795 #32 Feb 22 2025 09:57:02 %S A281795 0,4,16,36,60,88,132,172,224,284,344,416,484,568,664,756,856,956,1076, %T A281795 1200,1324,1452,1600,1740,1884,2040,2212,2392,2560,2732,2928,3120, %U A281795 3332,3536,3748,3980,4192,4428,4660,4920,5172,5412,5688,5956,6248,6528,6804,7104,7400,7716 %N A281795 Number of unit squares (partially) covered by a disk of radius n centered at the origin. %C A281795 Touching a unit square does not count as covering. E.g., the disk with radius 5 does not cover the unit square with (3, 4) as bottom-left corner. %H A281795 Robert Israel, <a href="/A281795/b281795.txt">Table of n, a(n) for n = 0..2000</a> %F A281795 a(n) = 4*A001182(n) + A242118(n). - _Andrey Zabolotskiy_, Jan 30 2017 %F A281795 a(n) = Sum_{k=0..n-1} 4*ceiling(sqrt(n^2-k^2)). - _Luis Mendo_, Aug 09 2021 %e A281795 a(4) = 4 * 15 = 60 because in the positive quadrant 15 unit squares are covered and the problem is symmetrical. In the bounding box of the circle only the unit squares in the corners are not (partially) covered, so a(4) = 8*8 - 4 = 60. %p A281795 N:= 100: # for a(0)..a(N) %p A281795 V:=Array(0..N): %p A281795 for i from 0 to N do %p A281795 for j from 0 to i do %p A281795 r:= sqrt(i^2 + j^2); %p A281795 if r::integer then r:= r+1 else r:= ceil(r) fi; %p A281795 if r > N then break fi; %p A281795 if i=j then m:= 4 else m:= 8 fi; %p A281795 V[r..N]:= V[r..N] +~ m; %p A281795 od od: %p A281795 convert(V,list); # _Robert Israel_, Feb 21 2025 %t A281795 A281795[n_] := 4*Sum[Ceiling[Sqrt[n^2 - k^2]], {k, 0, n-1}]; %t A281795 Array[A281795, 100, 0] (* _Paolo Xausa_, Feb 21 2025 *) %o A281795 (Python) %o A281795 a = lambda n: sum(4 for x in range(n) for y in range(n) %o A281795 if x*x + y*y < n*n) %o A281795 (Octave) %o A281795 a = @(n) 4*sum(ceil(sqrt(n.^2-(0:n-1).^2))); % _Luis Mendo_, Aug 09 2021 %Y A281795 Cf. A001182, A242118. %K A281795 nonn,easy %O A281795 0,2 %A A281795 _Orson R. L. Peters_, Jan 30 2017