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.
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, 10, 11, 9, 11, 11, 13, 11, 13, 11, 13, 11, 13, 11, 13, 13, 15, 12, 15, 13, 15, 13, 15, 13, 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
Offset: 0
Keywords
Examples
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.
Links
- Rajan Murthy, Table of n, a(n) for n = 0..4999
Crossrefs
Programs
-
Scilab
function index = n_edgeindex (N) if N < 1 then N = 1 end N = floor(N) i = 0:ceil(N/2) i = i^2 index = i for j = 1:length(i) index = [index i+ i(j).*ones(i)] end index = unique(index) index = index(1:ceil(N)) d = diff(index)/2 d = d + index(1:length(d)) index = gsort([index d],"g","i") index = index(1:N) endfunction function l = n_edge_n (i) l=0 h=0 while (i > (2*h^2)) h=h+1 end if i < (2*h^2) then l = l+1 end if i >1 then t=[0 1] while (i>max(t)) t = [t (sqrt(max(t))+1)^2] end for j = 1:h b=t t=[2*(j)^2 (j+1)^2 + (j)^2] while (i>max(t)) t = [t (sqrt(max(t)-(j)^2)+1)^2 + (j)^2] end l = l+ 2*(length(b)-length(t)) if max(t) == i then l = l-2 end end end endfunction function a =n_edge (N) if N <1 then N =1 end N = floor(N) a= [] index = n_edgeindex(N) for i = index a = [a n_edge_n(i)] end endfunction
Comments