OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..200
Index entries for linear recurrences with constant coefficients, signature (2,4,-8,-4,8).
FORMULA
G.f.: x*(1+2*x*(1+x*(4-x-11*x^2+3*x^3+7*x^4-x^5) / ((1-2*x)*(1-2*x^2)^2))). [Confirmed by Andrew Howroyd, Mar 27 2020]
a(n) = 2*a(n-1) + 4*a(n-2) - 8*a(n-3) - 4*a(n-4) + 8*a(n-5) for n>8. - Colin Barker, Mar 27 2020 [Confirmed by Andrew Howroyd, Mar 27 2020]
EXAMPLE
a(1) = 1;
+--*--+
a(2) = 2;
+ *--* *--* +
| | | | | |
*--* + + *--*
PROG
(Python)
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A(start, goal, n, k):
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
def A333571(n, k):
if n == 1: return 1
s = 0
for i in range(1, n + 1):
for j in range(k * n - n + 1, k * n + 1):
s += A(i, j, k, n)
return s
def A333575(n):
return A333571(n, 3)
print([A333575(n) for n in range(1, 15)])
(PARI) Vec(x*(1 - 2*x^3 - 2*x^4 + 6*x^5 - 2*x^6 - 2*x^7) / ((1 - 2*x)*(1 - 2*x^2)^2) + O(x^40)) \\ Colin Barker, Mar 29 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Mar 27 2020
EXTENSIONS
Terms a(22) and beyond from Andrew Howroyd, Mar 27 2020
STATUS
approved