login
Number of regions in a regular drawing of the complete bipartite graph K_{n,n}.
29

%I #42 Mar 12 2023 09:07:09

%S 0,2,12,40,96,204,368,634,1012,1544,2236,3186,4360,5898,7764,10022,

%T 12712,16026,19844,24448,29708,35756,42604,50602,59496,69650,80940,

%U 93600,107540,123316,140428,159642,180632,203618,228556,255822,285080,317326,352020,389498

%N Number of regions in a regular drawing of the complete bipartite graph K_{n,n}.

%H Chai Wah Wu, <a href="/A290131/b290131.txt">Table of n, a(n) for n = 1..10000</a>

%H Martin Griffiths, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL13/Griffiths2/griffiths.html">Counting the regions in a regular drawing of K_{n,n}</a>, J. Int. Seq. 13 (2010) # 10.8.5. See Lemma 2 and Table 1.

%H Stéphane Legendre, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL12/Legendre/legendre2.html">The Number of Crossings in a Regular Drawing of the Complete Bipartite Graph</a>, J. Integer Seqs., Vol. 12, 2009.

%H N. J. A. Sloane, <a href="/A115004/a115004.txt">Families of Essentially Identical Sequences</a>, Mar 24 2021 (Includes this sequence)

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CompleteBipartiteGraph.html">Complete Bipartite Graph</a>

%F a(n) = A115004(n-1) + (n-1)^2.

%F a(n) = 2*(n-1)^2 + Sum_{i=2..n-1} (n-i)*(2n-i)*phi(i). - _Chai Wah Wu_, Aug 16 2021

%p A290131 := proc(n)

%p A115004(n-1)+(n-1)^2 ;

%p end proc:

%p seq(A290131(n),n=1..30) ;

%t z[n_] := Sum[(n - i + 1)(n - j + 1) Boole[GCD[i, j] == 1], {i, n}, {j, n}];

%t a[n_] := z[n - 1] + (n - 1)^2;

%t Array[a, 40] (* _Jean-François Alcover_, Mar 24 2020 *)

%o (Python)

%o from math import gcd

%o def a115004(n):

%o r=0

%o for a in range(1, n + 1):

%o for b in range(1, n + 1):

%o if gcd(a, b)==1:r+=(n + 1 - a)*(n + 1 - b)

%o return r

%o def a(n): return a115004(n - 1) + (n - 1)**2

%o print([a(n) for n in range(1, 51)]) # _Indranil Ghosh_, Jul 20 2017, after Maple code

%o (Python)

%o from sympy import totient

%o def A290131(n): return 2*(n-1)**2 + sum(totient(i)*(n-i)*(2*n-i) for i in range(2,n)) # _Chai Wah Wu_, Aug 16 2021

%Y Cf. A115004, A159065, A290132, A331754.

%Y For K_n see A007569, A007678, A135563.

%Y The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n. - _N. J. A. Sloane_, Feb 04 2020

%K nonn,easy

%O 1,2

%A _R. J. Mathar_, Jul 20 2017