|
PROG
|
(PARI) default(realprecision, 120);
{a(n) = round(prod(j=1, 2*n-1, prod(k=j+1, 2*n-1-j, 4-4*cos(j*Pi/(2*n))*cos(k*Pi/(2*n)))))}
(PARI) {a007341(n) = polresultant(polchebyshev(n-1, 2, x/2), polchebyshev(n-1, 2, (4-x)/2))};
{a334088(n) = sqrtint(polresultant(polchebyshev(2*n, 1, x/2), polchebyshev(2*n, 1, I*x/2)))};
{a(n) = if(n==0, 1, sqrtint(a007341(n)*a334088(n)/n))}
(PARI) default(realprecision, 120);
{a(n) = if(n==0, 1, round(4^((n-1)^2)*prod(j=1, n-1, prod(k=j+1, n-1, 1-(cos(j*Pi/(2*n))*cos(k*Pi/(2*n)))^2))))} \\ Seiichi Manyama, Jan 02 2021
(Python)
# Using graphillion
from graphillion import GraphSet
def make_HMD(n):
s = 1
grids = []
for i in range(2 * n, 0, -2):
for j in range(i - 2):
a, b, c = s + j, s + j + 1, s + i + j
grids.extend([(a, b), (b, c)])
grids.append((s + i - 2, s + i - 1))
s += i
return grids
if n == 0: return 1
universe = make_HMD(n)
GraphSet.set_universe(universe)
spanning_trees = GraphSet.trees(is_spanning=True)
return spanning_trees.len()
print([A340176(n) for n in range(7)])
|