Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #22 Jul 19 2023 07:56:58
%S 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,
%T 1,877,877,674,471,160,61,10,1,4140,4140,3263,2386,856,385,75,14,1,
%U 21147,21147,17007,12867,4802,2416,520,135,15,1
%N Square array related to Bell numbers read by antidiagonals.
%H G. C. Greubel, <a href="/A123158/b123158.txt">Antidiagonals n = 0..50, flattened</a>
%F 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).
%F A(n, 0) = A000110(n).
%F A(n, 1) = A000110(n+1).
%F A(n, 2) = A005493(n).
%F A(n, 3) = A033452(n).
%F A(n, 4) = A003128(n+2).
%F T(n, k) = A(n-k, k) (antidiagonals).
%e Square array, A(n, k), begins:
%e 1, 1, 1, 1, 1, ... (Row n=0: A000012);
%e 1, 2, 3, 5, 6, ... (Row n=1: A117142);
%e 2, 5, 10, 22, 31, ...;
%e 5, 15, 37, 99, 160, ...;
%e 15, 52, 151, 471, 856, ...;
%e 52, 203, 674, 2386, 4802, ...;
%e Antidiagonals, T(n, k), begin as:
%e 1;
%e 1, 1;
%e 2, 2, 1;
%e 5, 5, 3, 1;
%e 15, 15, 10, 5, 1;
%e 52, 52, 37, 22, 6, 1;
%e 203, 203, 151, 99, 31, 9, 1;
%e 877, 877, 674, 471, 160, 61, 10, 1;
%t A[0, _?NonNegative] = 1;
%t 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]]];
%t Table[A[n-k, k], {n,0,10}, {k,0,n}]//Flatten (* _Jean-François Alcover_, Feb 21 2020 *)
%o (Magma)
%o function A(n,k)
%o if k lt 0 or n lt 0 then return 0;
%o elif n eq 0 then return 1;
%o elif (k mod 2) eq 1 then return A(n,k-1) + (1/2)*(k+1)*A(n-1,k+1);
%o else return A(n,k-1) + A(n-1,k+1);
%o end if;
%o end function;
%o T:= func< n,k | A(n-k,k) >;
%o [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Jul 18 2023
%o (SageMath)
%o @CachedFunction
%o def A(n,k):
%o if (k<0 or n<0): return 0
%o elif (n==0): return 1
%o elif (k%2==1): return A(n,k-1) +(1/2)*(k+1)*A(n-1,k+1)
%o else: return A(n,k-1) +A(n-1,k+1)
%o def T(n,k): return A(n-k,k)
%o flatten([[T(n,k) for k in range(n+1)] for n in range(12)]) # _G. C. Greubel_, Jul 18 2023
%Y Columns include: A000110 (Bell numbers), A003128, A005493, A033452.
%Y Rows include: A000012, A117142.
%K easy,nonn,tabl
%O 0,4
%A _Philippe Deléham_, Oct 01 2006