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.
%I A331776 #70 Aug 16 2021 14:09:02 %S A331776 4,56,208,496,1016,1784,2984,4656,6968,9944,13976,18928,25360,33128, %T A331776 42488,53600,67232,82904,101744,123232,147896,175784,208296,244416, %U A331776 285600,331352,382608,439008,502776,571912,649480,734176,826880,927416,1037288,1155152,1284992 %N A331776 Number of regions in a "frame" of size n X n (see Comments for definition). %C A331776 A "frame" of size n X n is formed from a grid of (n+1) X (n+1) points with the central grid of (n-3) X (n-3) points removed. If n is less than 3 then no points are removed, and a(n) = A255011(n). From now on we assume n >= 3. %C A331776 If we focus on the squares rather than the points, the frame consists of an n X n array of squares with the central block of (n-2) X (n-2) squares removed. %C A331776 The resulting structure has an outer perimeter with 4*n points and an inner perimeter with 4*n-8 points, for a total of 8*n-8 perimeter points. The frame itself is the strip of width 1 between the inner and outer perimeters. %C A331776 Now join every pair of perimeter points, both inner and outer, by a line segment, provided the line remains inside the frame. The sequence gives the number of regions in the resulting figure. %C A331776 Theorem. Let z(n) = Sum_{i, j = 1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) (this is A115004). Then, for n >= 2, a(n) = 4*z(n) + 16*n^2 - 20*n. - _Scott R. Shannon_ and _N. J. A. Sloane_, Mar 06 2020 %H A331776 Jinyuan Wang, <a href="/A331776/b331776.txt">Table of n, a(n) for n = 1..1000</a> %H A331776 Scott R. Shannon, <a href="/A331452/a331452_6.png">Colored illustration for a(1) = 4</a> %H A331776 Scott R. Shannon, <a href="/A331452/a331452_12.png">Colored illustration for a(2) = 56</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776.png">Colored illustration for a(3) = 208</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_1.png">Colored illustration for a(4) = 496</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_2.png">Colored illustration for a(5) = 1016</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_3.png">Colored illustration for a(6) = 1784</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_4.png">Colored illustration for a(7) = 2984</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_5.png">Colored illustration for a(8) = 4656</a> %H A331776 Scott R. Shannon, <a href="/A331776/a331776_6.png">Colored illustration for a(8) = 4656</a> (Another version) %H A331776 Zach Shannon, <a href="/A331776/a331776_7.png">Illustration for a(8) = 4656 used as a frame for the OEIS logo</a> %H A331776 Zach Shannon, <a href="/A331776/a331776_8.png">Illustration for a(8) = 4656 used as a frame for the OEIS logo</a> (detail) %H A331776 N. J. A. Sloane, <a href="/A331457/a331457.pdf">Illustration for a(3) = 208</a> %F A331776 For n > 1, a(n) = 20*n*(n-1) + 4*Sum_{i=2..n} (n+1-i)*(2n+2-i)*phi(i). - _Chai Wah Wu_, Aug 16 2021 %p A331776 # First define z(n) = A115004 %p A331776 z := proc(n) %p A331776 local a, b, r ; %p A331776 r := 0 ; %p A331776 for a from 1 to n do %p A331776 for b from 1 to n do %p A331776 if igcd(a, b) = 1 then %p A331776 r := r+(n+1-a)*(n+1-b); %p A331776 end if; %p A331776 end do: %p A331776 end do: %p A331776 r ; %p A331776 end proc: %p A331776 A331776 := n -> if n=1 then 4 else 4*z(n)+16*n^2 - 20*n; fi; %p A331776 [seq(A331776(n),n=1..40)]; # _N. J. A. Sloane_, Mar 09 2020 %o A331776 (PARI) a(n) = 4*sum(i=1, n, sum(j=1, n, if(gcd(i, j)==1, (n+1-i)*(n+1-j), 0))) + 16*n^2 - 20*n + 4*(n==1); \\ _Jinyuan Wang_, Aug 07 2021 %o A331776 (Python) %o A331776 from sympy import totient %o A331776 def A331776(n): return 4 if n == 1 else 20*n*(n-1) + 4*sum(totient(i)*(n+1-i)*(2*n+2-i) for i in range(2,n+1)) # _Chai Wah Wu_, Aug 16 2021 %Y A331776 This is the main diagonal of A331457. Equals 4 times A332594. %Y A331776 Cf. A255011, A115004. %Y A331776 The analogous sequence for an n X n block of squares (if the center block is not removed) is A331452. %K A331776 nonn %O A331776 1,1 %A A331776 _Scott R. Shannon_ and _N. J. A. Sloane_, Feb 08 2020 %E A331776 More terms from _N. J. A. Sloane_, Mar 09 2020