The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.



(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A242118 Number of unit squares that intersect the circumference of a circle of radius n centered at (0,0). 9


%S 0,4,12,20,28,28,44,52,60,68,68,84,92,92,108,108,124,124,140,148,148,

%T 164,172,180,188,180,196,212,220,220,228,244,252,260,260,268,284,284,

%U 300,300,308,316,332,340,348,348,364,372,380,388,380

%N Number of unit squares that intersect the circumference of a circle of radius n centered at (0,0).

%C For the points that form the Pythagorean triple (for example see illustration n = 5, on the first quadrant at coordinate (4,3) and (3,4)), the transit of circumference occurs exactly at the corners, therefore there are no additional intersecting squares on the upper or lower rows (diagonally NE & SW directions) of such points. When the center of the circle is chosen at the middle of a square grid centered at (1/2,0), the sequence will be 2*A004767(n-1).

%H Kival Ngaokrajang, <a href="/A242118/a242118_1.pdf">Illustration of initial terms</a>

%F a(n) = 4*Sum{k=1..n} ceiling(sqrt(n^2 - (k-1)^2)) - floor(sqrt(n^2 - k^2)). - _Orson R. L. Peters_, Jan 30 2017

%F a(n) = 8*n - A046109(n) for n > 0. - conjectured by _Orson R. L. Peters_, Jan 30 2017, proved by _Andrey Zabolotskiy_, Jan 31 2017

%o (Python)

%o a = lambda n: sum(4 for x in range(n) for y in range(n)

%o if x**2 + y**2 < n**2 and (x+1)**2 + (y+1)**2 > n**2)

%o (Python)

%o from sympy import factorint

%o def a(n):

%o r = 1

%o for p, e in factorint(n).items():

%o if p%4 == 1: r *= 2*e + 1

%o return 8*n - 4*r if n > 0 else 0

%Y Cf. A009003, A004767.

%K nonn

%O 0,2

%A _Kival Ngaokrajang_, May 05 2014

%E Terms corrected by _Orson R. L. Peters_, Jan 30 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 5 06:34 EDT 2020. Contains 335459 sequences. (Running on oeis4.)