cp's OEIS Frontend

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.

A261849 Number of squares in an n X n grid that are enclosed in a circle of diameter n (having the same center as the grid).

This page as a plain text file.
%I A261849 #46 Sep 19 2017 03:43:41
%S A261849 0,0,1,4,9,16,21,32,45,60,69,88,101,120,145,164,185,216,241,276,293,
%T A261849 332,365,392,437,476,509,556,593,648,681,732,785,832,885,936,989,1052,
%U A261849 1109,1176,1225,1288,1353,1428,1489,1560,1625,1696,1781,1860,1933,2016,2085,2180,2241,2340,2425,2512,2609,2700,2793,2876,2973,3080,3173
%N A261849 Number of squares in an n X n grid that are enclosed in a circle of diameter n (having the same center as the grid).
%C A261849 a(1)=0 by definition.
%C A261849 The idea behind the sequence was originally proposed at http://www.sanaristikot.net on Aug 19 2015 by Jaska Himberg.
%H A261849 Yi Yang, <a href="/A261849/b261849.txt">Table of n, a(n) for n = 1..10000</a>
%H A261849 V. J. Pohjola ("Olavi Kivalo") and Jaakko Himberg ("Jaska"), <a href="http://www.sanaristikot.net/keskustelut/index.php?ryhma=1&amp;p1=vast.php&amp;p2=info_3.php&amp;id=8545&amp;alku=30&amp;t=k1">8545.Lukujono16</a>
%H A261849 Giovanni Resta, <a href="/A261849/a261849.png">Representation of a(3)-a(11)</a>
%t A261849 c[n_, i_, j_] := Ceiling[Sqrt[(n - 2 i)^2 + (n - 2 j)^2]];
%t A261849 t1[q_] := Take[q, 1]; t2[p_] := Take[p, -1]; p2[r_] := Power[r, 2];
%t A261849 area = {}; (Do[
%t A261849   a = {}; (Do[
%t A261849     If[c[n, i, j] == n || c[n, i, j] == n - 1 || c[n, i, j] == n - 2,
%t A261849      AppendTo[a, {i, j}]], {i, 1, Ceiling[n/2 (1 - Sqrt[2]/2)]}, {j, i,
%t A261849      Floor[n/2]}]);
%t A261849   b = (n - 2*Map[t2, Flatten[Map[t1, GatherBy[a, First]], 1]]);
%t A261849   sum1 = 4*Apply[Plus, Drop[b, -1]]; sum2 = Map[p2, Last[b]];
%t A261849   AppendTo[area, (sum1 + sum2)], {n, 2, 100}]);
%t A261849 Flatten[{0, area}]
%t A261849 a[1] = 0; a[n_] := If[EvenQ[n], 4 Sum[ Floor[ Sqrt[(n/2)^2 - k^2]], {k, n/2}], 4 Floor[n/2] - 3 + 4 Sum[Floor[-1/2 + Sqrt[(n/2)^2 - (k + 1/2)^2]], {k, n/2 - 1}]]; Array[a, 60] (* _Giovanni Resta_, Sep 10 2015 *)
%Y A261849 Cf. A085690, A242118.
%K A261849 nonn,easy
%O A261849 1,4
%A A261849 _V.J. Pohjola_, Sep 03 2015