|
|
A340043
|
|
Triangle T(n,k), n>=1, 0 <= k <= A002620(n-1), read by rows, where T(n,k) is the number of self-avoiding paths of length 2*(n+k) along the edges of a grid with n X n square cells, which do not pass above the diagonal, start at the lower left corner and finish at the upper right corner.
|
|
3
|
|
|
1, 2, 5, 2, 14, 16, 10, 42, 90, 123, 94, 20, 132, 440, 954, 1460, 1524, 922, 248, 429, 2002, 6017, 13688, 24582, 34536, 35487, 24042, 8852, 1072, 1430, 8736, 33784, 101232, 251646, 530900, 944042, 1369110, 1541774, 1264402, 693740, 221738, 31178
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
Triangle begins:
1;
2;
5, 2;
14, 16, 10;
42, 90, 123, 94, 20;
132, 440, 954, 1460, 1524, 922, 248;
429, 2002, 6017, 13688, 24582, 34536, 35487, 24042, 8852, 1072;
|
|
PROG
|
(Python)
# Using graphillion
from graphillion import GraphSet
def make_stairs(n):
s = 1
grids = []
for i in range(n + 1, 1, -1):
for j in range(i - 1):
a, b, c = s + j, s + j + 1, s + i + j
grids.extend([(a, b), (a, c)])
s += i
return grids
universe = make_stairs(n)
GraphSet.set_universe(universe)
start, goal = n + 1, (n + 1) * (n + 2) // 2
paths = GraphSet.paths(start, goal)
return [paths.len(2 * (n + k)).len() for k in range((n - 1) * (n - 1) // 4 + 1)]
print([i for n in range(1, 9) for i in A340043(n)])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|