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!)
A338960 Number of (undirected) paths in C_4 X P_n. 5

%I #22 Dec 19 2020 14:27:57

%S 12,444,7584,103184,1246892,14010212,150042016,1554630384,15735477148,

%T 156604841764,1539509238384,14997746124304,145132198165132,

%U 1397493793301476,13407313676392384,128278229316758192,1224872135665718780,11678406201771406628,111224649402691424912,1058446545979095492816

%N Number of (undirected) paths in C_4 X P_n.

%H <a href="/A338960/b338960.txt">Table of n, a(n) for n = 1..20</a>

%o (Python)

%o # Using graphillion

%o from graphillion import GraphSet

%o def make_CnXPk(n, k):

%o grids = []

%o for i in range(1, k + 1):

%o for j in range(1, n):

%o grids.append((i + (j - 1) * k, i + j * k))

%o grids.append((i + (n - 1) * k, i))

%o for i in range(1, k * n, k):

%o for j in range(1, k):

%o grids.append((i + j - 1, i + j))

%o return grids

%o def A(start, goal, n, k):

%o universe = make_CnXPk(n, k)

%o GraphSet.set_universe(universe)

%o paths = GraphSet.paths(start, goal)

%o return paths.len()

%o def B(n, k):

%o m = k * n

%o s = 0

%o for i in range(1, m):

%o for j in range(i + 1, m + 1):

%o s += A(i, j, n, k)

%o return s

%o def A338960(n):

%o return B(4, n)

%o print([A338960(n) for n in range(1, 11)])

%Y Cf. A003752, A338709, A338961, A338962, A338963.

%K nonn

%O 1,1

%A _Seiichi Manyama_, Dec 18 2020

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 May 2 19:04 EDT 2024. Contains 372203 sequences. (Running on oeis4.)