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!)
A234300 Number of unit squares, aligned with a Cartesian grid, partially encircled along the edge of the first quadrant of a circle centered at the origin ordered by increasing radius. 9

%I #31 Apr 28 2014 14:56:26

%S 0,1,1,3,2,3,3,5,3,5,4,5,5,7,5,7,5,7,7,9,7,9,8,9,7,9,7,11,9,11,9,11,

%T 10,11,9,11,11,13,11,13,11,13,11,13,11,13,13,15,12,15,13,15,13,15,13,

%U 15,13,15,15,17,13,17,15,17,16,17,15,17,15,17,15,17,17,19,17,19,15,19,17,19,17,19,17,19,18,19,17,21,19,21,19,21,19,21,19,21,19,21,19,21

%N Number of unit squares, aligned with a Cartesian grid, partially encircled along the edge of the first quadrant of a circle centered at the origin ordered by increasing radius.

%C The first decrease from a(4) = 3 to a(5) = 2 occurs when the radius squared increases from an arbitrary position between 1 and 2 (when 3 squares are on the edge) to exactly 2 (when only 2 squares are on the edge because the circle of square radius 2 passes through the upper right corner on the y=x line). Similar decreases occur when the circle passes through other upper right corners. At least some (if not all) adjacent duplicates occur when the square radius corresponds to a perfect square, that is a corner which is only a lower right corner, i.e., on the y = 0 line. For example, a(6)=a(7)=3 occurs when, for n = 6 , a(n) corresponding to the interval between 2 and 4; and, for n=7, a(n) corresponding to the exact square radius of 4. Some of the confusion may come from the fact that for odd n, there is a unique circle corresponding to elements of a(n) (passing through the corner of specific square(s) on the grid), while for even n, there is a set of circles with a range of radii (which do not pass through corners) corresponding to the elements of a(n). It seems easier to organize the concept in terms of intervals and corners for the sake of consistency.

%C a(n) is even when the radius squared corresponds to an element of A024517.

%H Rajan Murthy, <a href="/A234300/b234300.txt">Table of n, a(n) for n = 0..4999</a>

%F a(2k+1) = a(2k) + 2*A000161(A001481(k+1)) - A010052(A001481(k+1)/2). - _Rajan Murthy_, Jan 14 2013

%F a(2k) = a(2k-1) - 2*(A000161(A001481(k+1)) - A010052(A001481(k+1))) + A010052(A001481(k+1)/2). - _Rajan Murthy_, Jan 14 2013

%e At radius 0, there are no partially filled squares. At radius >1 but < sqrt(2), there are 3 partially filled squares along the edge of the circle. At radius = sqrt(2), there are 2 partially filled squares along the edge of the circle.

%o (Scilab)

%o function index = n_edgeindex (N)

%o if N < 1 then

%o N = 1

%o end

%o N = floor(N)

%o i = 0:ceil(N/2)

%o i = i^2

%o index = i

%o for j = 1:length(i)

%o index = [index i+ i(j).*ones(i)]

%o end

%o index = unique(index)

%o index = index(1:ceil(N))

%o d = diff(index)/2

%o d = d + index(1:length(d))

%o index = gsort([index d],"g","i")

%o index = index(1:N)

%o endfunction

%o function l = n_edge_n (i)

%o l=0

%o h=0

%o while (i > (2*h^2))

%o h=h+1

%o end

%o if i < (2*h^2) then

%o l = l+1

%o end

%o if i >1 then

%o t=[0 1]

%o while (i>max(t))

%o t = [t (sqrt(max(t))+1)^2]

%o end

%o for j = 1:h

%o b=t

%o t=[2*(j)^2 (j+1)^2 + (j)^2]

%o while (i>max(t))

%o t = [t (sqrt(max(t)-(j)^2)+1)^2 + (j)^2]

%o end

%o l = l+ 2*(length(b)-length(t))

%o if max(t) == i then

%o l = l-2

%o end

%o end

%o end

%o endfunction

%o function a =n_edge (N)

%o if N <1 then

%o N =1

%o end

%o N = floor(N)

%o a= []

%o index = n_edgeindex(N)

%o for i = index

%o a = [a n_edge_n(i)]

%o end

%o endfunction

%Y Cf. A001481 (corresponds to the square radius of alternate entries), A232499 (number of completely encircled squares when the radii are indexed by A000404), A235141 (first differences), A024517.

%Y A237708 is the analog for the 3-dimensional Cartesian lattice and A239353 for the 4-dimensional Cartesian lattice.

%K nonn

%O 0,4

%A _Rajan Murthy_, Dec 22 2013

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 19 03:46 EDT 2024. Contains 371782 sequences. (Running on oeis4.)