OFFSET
2,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 2..1000
Paul Barry, Centered polygon numbers, heptagons and nonagons, and the Robbins numbers, arXiv:2104.01644 [math.CO], 2021.
M. Peto, Studies of protein designability using reduced models, Thesis, 2007.
Index entries for linear recurrences with constant coefficients, signature (2,4,2).
FORMULA
G.f.: (x*(1+x))^2/(1-2*x-4*x^2-2*x^3).
a(n) = 2*a(n-1) + 4*a(n-2) + 2*a(n-3) for n > 4.
EXAMPLE
a(2) = 1:
*---*
/ /
* *
/ /
*---*
a(3) = 4:
* *---* *---*---*
/ \ / / \ /
* * * *---* *
/ / / /
*---*---* *---*---*
*---*---* *---*---*
/ / / /
* * * * *---*
/ / \ / / \
*---* * *---*---*
MATHEMATICA
Drop[CoefficientList[Series[(x (1 + x))^2/(1 - 2 x - 4 x^2 - 2 x^3), {x, 0, 28}], x], 2] (* Michael De Vlieger, Jul 06 2021 *)
PROG
(PARI) my(N=66, x='x+O('x^N)); Vec((x*(1+x))^2/(1-2*x-4*x^2-2*x^3))
(Python)
# Using graphillion
from graphillion import GraphSet
def make_T_nk(n, k):
grids = []
for i in range(1, k + 1):
for j in range(1, n):
grids.append((i + (j - 1) * k, i + j * k))
if i < k:
grids.append((i + (j - 1) * k, i + j * k + 1))
for i in range(1, k * n, k):
for j in range(1, k):
grids.append((i + j - 1, i + j))
return grids
def A339849(n, k):
universe = make_T_nk(n, k)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles(is_hamilton=True)
return cycles.len()
def A339850(n):
return A339849(3, n)
print([A339850(n) for n in range(2, 21)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 19 2020
STATUS
approved