OFFSET
1,2
FORMULA
Conjecture: a(n) = (27*2^n - n^3 - 26*n - 24)/3.
Conjecture: G.f.: x*(1+2*x-5*x^2+2*x^3+2*x^4)/((1-x)^4*(1-2*x)).
EXAMPLE
a(1) = 1;
+--+
a(2) = 8;
+--+ + + +--* + *
| | | |
* * *--* * + *--+
-------------------------
*--+ * + *--* * *
| | | |
+ * +--* + + +--+
a(3) = 29;
+--+ + + + + +--* + *
| | | | | |
* * *--* * * * + *--+
| |
* * * * *--* * * * *
--------------------------------
+ * +--* +--* + * + *
| | | | |
* + *--* * * *--* * *
| | | | | |
*--* *--+ * + * + *--+
--------------------------------
*--+ * + * + *--* * *
| | | | |
+ * +--* + * + + +--+
| |
* * * * *--+ * * * *
--------------------------------
* * *--* * * * * *--+
| | |
+ + + * +--* + * *--*
| | | | | |
*--* * + * + *--+ +--*
--------------------------------
*--+ * + * + *--* * *
| | | | |
* * *--* * * * + *--+
| | | | |
+ * + * +--* + * + *
--------------------------------
* * *--* * * * *
| |
* + * * *--* * *
| | | | |
+--* + + + + +--+
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)
return paths.len()
def A333509(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 A333510(n):
return A333509(n, 2)
print([A333510(n) for n in range(1, 20)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Mar 25 2020
STATUS
approved