OFFSET
0,3
LINKS
Alois P. Heinz, Antidiagonals n = 0..140, flattened
FORMULA
G.f. of column k: 1/(x^k*(1-x-3*x^(k+1))).
A(n,k) = 4^n if k=0, else A(n,k) = 3*n+1 if n<=k+1, else A(n,k) = A(n-1,k) + 3*A(n-k-1,k).
EXAMPLE
A (3,1) = 19, because 19 quaternary words of length 3 have at least 1 0-digit between any other digits: 000, 001, 002, 003, 010, 020, 030, 100, 101, 102, 103, 200, 201, 202, 203, 300, 301, 301, 303.
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, ...
4, 4, 4, 4, 4, 4, 4, 4, ...
16, 7, 7, 7, 7, 7, 7, 7, ...
64, 19, 10, 10, 10, 10, 10, 10, ...
256, 40, 22, 13, 13, 13, 13, 13, ...
1024, 97, 43, 25, 16, 16, 16, 16, ...
4096, 217, 73, 46, 28, 19, 19, 19, ...
16384, 508, 139, 76, 49, 31, 22, 22, ...
MAPLE
A:= proc(n, k) option remember; if k=0 then 4^n elif n<=k+1 then 3*n+1 else A(n-1, k) +3*A(n-k-1, k) fi end: seq(seq(A(n, d-n), n=0..d), d=0..13);
MATHEMATICA
a[n_, 0] := 4^n; a[n_, k_] /; n <= k+1 := 3*n+1; a[n_, k_] := a[n, k] = a[n-1, k] + 3*a[n-k-1, k]; Table[a[n-k, k], {n, 0, 13}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Jan 15 2014, after Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Aug 16 2008
STATUS
approved