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!)
A281795 Number of unit squares (partially) covered by a disk of radius n centered at the origin. 2
0, 4, 16, 36, 60, 88, 132, 172, 224, 284, 344, 416, 484, 568, 664, 756, 856, 956, 1076, 1200, 1324, 1452, 1600, 1740, 1884, 2040, 2212, 2392, 2560, 2732, 2928, 3120, 3332, 3536, 3748, 3980, 4192, 4428, 4660, 4920, 5172, 5412, 5688, 5956, 6248, 6528, 6804, 7104, 7400, 7716 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
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.
LINKS
FORMULA
a(n) = 4*A001182(n) + A242118(n). - Andrey Zabolotskiy, Jan 30 2017
a(n) = Sum_{k=0..n-1} 4*ceiling(sqrt(n^2-k^2)). - Luis Mendo, Aug 09 2021
EXAMPLE
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.
PROG
(Python)
a = lambda n: sum(4 for x in range(n) for y in range(n)
if x*x + y*y < n*n)
(Matlab / Octave)
a = @(n) 4*sum(ceil(sqrt(n.^2-(0:n-1).^2))); % Luis Mendo, Aug 09 2021
CROSSREFS
Sequence in context: A014727 A174597 A044065 * A063540 A349223 A055808
KEYWORD
nonn,easy
AUTHOR
Orson R. L. Peters, Jan 30 2017
STATUS
approved

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 April 24 19:39 EDT 2024. Contains 371963 sequences. (Running on oeis4.)