OFFSET
0,4
LINKS
G. C. Greubel, Antidiagonals n = 0..50, flattened
FORMULA
A(n, k) = 0 if n < 0, A(0, k) = 1 for k >= 0, A(n, k) = A(n, k-1) + (1/2)*(k+1)*A(n-1, k+1) if k is an odd number, A(n, k) = A(n, k-1) + A(n-1, k+1) if k is an even number (array).
A(n, 0) = A000110(n).
A(n, 1) = A000110(n+1).
A(n, 2) = A005493(n).
A(n, 3) = A033452(n).
A(n, 4) = A003128(n+2).
T(n, k) = A(n-k, k) (antidiagonals).
EXAMPLE
Square array, A(n, k), begins:
1, 1, 1, 1, 1, ... (Row n=0: A000012);
1, 2, 3, 5, 6, ... (Row n=1: A117142);
2, 5, 10, 22, 31, ...;
5, 15, 37, 99, 160, ...;
15, 52, 151, 471, 856, ...;
52, 203, 674, 2386, 4802, ...;
Antidiagonals, T(n, k), begin as:
1;
1, 1;
2, 2, 1;
5, 5, 3, 1;
15, 15, 10, 5, 1;
52, 52, 37, 22, 6, 1;
203, 203, 151, 99, 31, 9, 1;
877, 877, 674, 471, 160, 61, 10, 1;
MATHEMATICA
A[0, _?NonNegative] = 1;
A[n_, k_]:= A[n, k]= If[n<0 || k<0, 0, If[OddQ[k], A[n, k-1] + (1/2)(k+1) A[n-1, k+1], A[n, k-1] + A[n-1, k+1]]];
Table[A[n-k, k], {n, 0, 10}, {k, 0, n}]//Flatten (* Jean-François Alcover, Feb 21 2020 *)
PROG
(Magma)
function A(n, k)
if k lt 0 or n lt 0 then return 0;
elif n eq 0 then return 1;
elif (k mod 2) eq 1 then return A(n, k-1) + (1/2)*(k+1)*A(n-1, k+1);
else return A(n, k-1) + A(n-1, k+1);
end if;
end function;
T:= func< n, k | A(n-k, k) >;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 18 2023
(SageMath)
@CachedFunction
def A(n, k):
if (k<0 or n<0): return 0
elif (n==0): return 1
elif (k%2==1): return A(n, k-1) +(1/2)*(k+1)*A(n-1, k+1)
else: return A(n, k-1) +A(n-1, k+1)
def T(n, k): return A(n-k, k)
flatten([[T(n, k) for k in range(n+1)] for n in range(12)]) # G. C. Greubel, Jul 18 2023
CROSSREFS
KEYWORD
AUTHOR
Philippe Deléham, Oct 01 2006
STATUS
approved