A263159
Number A(n,k) of lattice paths starting at {n}^k and ending when k or any component equals 0, using steps that decrement one or more components by one; square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 7, 13, 1, 1, 1, 15, 157, 63, 1, 1, 1, 31, 2101, 5419, 321, 1, 1, 1, 63, 32461, 717795, 220561, 1683, 1, 1, 1, 127, 580693, 142090291, 328504401, 9763807, 8989, 1, 1, 1, 255, 11917837, 39991899123, 944362553521, 172924236255, 454635973, 48639, 1, 1
Offset: 0
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, ...
1, 1, 3, 7, 15, 31, ...
1, 1, 13, 157, 2101, 32461, ...
1, 1, 63, 5419, 717795, 142090291, ...
1, 1, 321, 220561, 328504401, 944362553521, ...
1, 1, 1683, 9763807, 172924236255, 7622403922836151, ...
Columns k=0+1, 2-10 give:
A000012,
A001850,
A115866,
A263162,
A263163,
A263164,
A263165,
A263166,
A263167,
A263168.
-
s:= proc(n) option remember; `if`(n=0, {[]},
map(x-> [[x[], 0], [x[], 1]][], s(n-1)))
end:
b:= proc(l) option remember; `if`(l=[] or l[1]=0, 1,
add((p-> `if`(p[1]<0, 0, `if`(p[1]=0, 1, b(p)))
)(sort(l-x)), x=s(nops(l)) minus {[0$nops(l)]}))
end:
A:= (n, k)-> b([n$k]):
seq(seq(A(n,d-n), n=0..d), d=0..10);
-
g[k_] := Table[Reverse[IntegerDigits[n, 2]][[;;k]], {n, 2^k+1, 2^(k+1)-1}];
b[l_] := b[l] = If[l[[1]] == 0, 1, Sum[b[Sort[l - h]], {h, g[k]}]];
a[n_, k_] := If[n == 0 || k == 0 || k == 1, 1, b[Table[n, {k}]]];
Table[a[n-k, k], {n, 0, 10}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Apr 25 2020, after Alois P. Heinz in A115866 *)
A126086
Number of paths from (0,0,0) to (n,n,n) such that at each step (i) at least one coordinate increases, (ii) no coordinate decreases, (iii) no coordinate increases by more than 1 and (iv) all coordinates are integers.
Original entry on oeis.org
1, 13, 409, 16081, 699121, 32193253, 1538743249, 75494983297, 3776339263873, 191731486403293, 9850349744182729, 510958871182549297, 26716694098174738321, 1406361374518034383189, 74456543501901550262689, 3961518532003397434536961, 211689479080817606497324033
Offset: 0
Illustrating a(1) = 13:
000 -> 001 -> 011 -> 111
000 -> 001 -> 101 -> 111
000 -> 001 -> 111
000 -> 010 -> 011 -> 111
000 -> 010 -> 110 -> 111
000 -> 010 -> 111
000 -> 100 -> 101 -> 111
000 -> 100 -> 110 -> 111
000 -> 100 -> 111
000 -> 011 -> 111
000 -> 101 -> 111
000 -> 110 -> 111
000 -> 111
- Alois P. Heinz, Table of n, a(n) for n = 0..500 (first 101 terms from Nick Hobson)
- A. Bostan, S. Boukraa, J.-M. Maillard, and J.-A. Weil, Diagonals of rational functions and selected differential Galois groups, arXiv preprint arXiv:1507.03227 [math-ph], 2015.
- E. Duchi and R. A. Sulanke, The 2^{n-1} Factor for Multi-Dimensional Lattice Paths with Diagonal Steps, Séminaire Lotharingien de Combinatoire, B51c (2004).
- Steffen Eger, On the Number of Many-to-Many Alignments of N Sequences, arXiv:1511.00622 [math.CO], 2015.
- Steffen Eger, The Combinatorics of Weighted Vector Compositions, arXiv:1704.04964 [math.CO], 2017.
- Nick Hobson, Python program
- L. Reid, Problem #8: How Many Paths from A to B?, Missouri State University's Challenge Problem Set from the 2005-2006 academic year.
- J. B. Slowinski, The Number of Multiple Alignments, Molecular Phylogenetics and Evolution 10:2 (1998), 264-266. doi:10.1006/mpev.1998.0522
-
f := proc(n) local i,k; add(add((-1)^k*binomial(k,i)*(-1)^i*binomial(i,n)^3,i=n..k),k=n..3*n) end: # Brendan McKay, Mar 03 2007
seq(sum(binomial(k,n)^3/2^(k+1),k=n..infinity),n=0..10); # Vladeta Jovovic, Mar 01 2008
-
m = 14; se = Series[1/(1 - x - y - z - x*y - x*z - y*z - x*y*z), {x, 0, m}, {y, 0, m}, {z, 0, m}]; a[n_] := Coefficient[se, (x*y*z)^n]; a[0] = 1; Table[a[n], {n, 0, m}] (* Jean-François Alcover, Sep 27 2011, after Max Alekseyev *)
Table[Sum[Sum[(-1)^k*Binomial[k,i]*(-1)^i*Binomial[i,n]^3,{i,n,k}],{k,n,3*n}],{n,0,20}] (* Vaclav Kotesovec, Mar 15 2014, after Brendan McKay *)
-
# Naive version - see link for better version.
def f(a, b):
if a == 0 or b == 0:
return 1
return f(a, b - 1) + f(a - 1, b) + f(a - 1, b - 1)
def g(a, b, c):
if a == 0:
return f(b, c)
if b == 0:
return f(c, a)
if c == 0:
return f(a, b)
return (
g(a, b, c - 1)
+ g(a, b - 1, c)
+ g(a - 1, b, c)
+ g(a, b - 1, c - 1)
+ g(a - 1, b, c - 1)
+ g(a - 1, b - 1, c)
+ g(a - 1, b - 1, c - 1)
)
for n in range(6):
print(g(n, n, n), end=", ")
Showing 1-2 of 2 results.
Comments