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!)
A332596 Number of quadrilateral regions in a "frame" of size n X n (see Comments in A331776 for definition), divided by 8. 4
0, 1, 10, 26, 63, 107, 189, 294, 455, 627, 891, 1202, 1650, 2121, 2719, 3392, 4292, 5239, 6470, 7832, 9463, 11129, 13205, 15460, 18164, 20919, 24130, 27572, 31679, 35945, 40977, 46340, 52384, 58511, 65421, 72718, 81104, 89589, 98989, 108860, 120062, 131551 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
See A331776 for many other illustrations.
Theorem. Let z(n) = Sum_{i, j = 1..n, gcd(i,j)=1} (n+1-i)*(n+1-j) (this is A115004) and z_2(n) = Sum_{i, j = 1..n, gcd(i,j)=2} (n+1-i)*(n+1-j) (this is A331761). Then, for n >= 2, 8*a(n) = 4*z(n) - 8*z_2(n) + 8*n^2 - 36*n + 24. - Scott R. Shannon and N. J. A. Sloane, Mar 06 2020
LINKS
Scott R. Shannon, Colored illustration for a(3) = 10 (there are 8*10 quadrilaterals).
FORMULA
For n > 1, a(n) = ((n-1)*(n-4) - Sum_{i=2..floor(n/2)} (n+1-i)*(2*n+2-7*i)*phi(i) + Sum_{i=floor(n/2)+1..n} (n+1-i)*(2*n+2-i)*phi(i))/2. - Chai Wah Wu, Aug 16 2021
MAPLE
V := proc(m, n, q) local a, i, j; a:=0;
for i from 1 to m do for j from 1 to n do
if gcd(i, j)=q then a:=a+(m+1-i)*(n+1-j); fi; od: od: a; end;
f := n -> if n=1 then 0 else 8*n^2 - 36*n + 24 + 4*V(n, n, 1) 8*V(n, n, 2); fi;
[seq(f(n)/8, n=1..60)]; # N. J. A. Sloane, Mar 10 2020
PROG
(PARI) a(n) = sum(i=1, n, sum(j=1, n, if(gcd(i, j)==1, (n+1-i)*(n+1-j), 0)))/2 - sum(i=1, n, sum(j=1, n, if(gcd(i, j)==2, (n+1-i)*(n+1-j), 0))) + n^2 - 9*n/2 + 3; \\ Jinyuan Wang, Aug 07 2021
(Python)
from sympy import totient
def A332596(n): return 0 if n == 1 else ((n-1)*(n-4) - sum(totient(i)*(n+1-i)*(2*n+2-7*i) for i in range(2, n//2+1)) + sum(totient(i)*(n+1-i)*(2*n+2-i) for i in range(n//2+1, n+1)))//2 # Chai Wah Wu, Aug 16 2021
CROSSREFS
Sequence in context: A125075 A209983 A055710 * A134420 A144255 A259290
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from N. J. A. Sloane, Mar 10 2020
STATUS
approved

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 18 10:28 EDT 2024. Contains 371779 sequences. (Running on oeis4.)