%I #29 Nov 03 2023 16:21:19
%S 1,1,1,1,0,1,1,2,0,1,1,1,1,0,1,1,4,1,1,0,1,1,2,3,0,1,0,1,1,7,3,3,0,1,
%T 0,1,1,4,6,1,2,0,1,0,1,1,12,7,7,1,2,0,1,0,1,1,7,12,3,5,0,2,0,1,0,1,1,
%U 20,16,15,3,5,0,2,0,1,0,1
%N Triangle read by rows: T(n,k) = number of palindromic compositions of n in which the largest part is equal to k, 1 <= k <= n.
%C A palindromic composition of a natural number m is an ordered partition of m into N+1 natural numbers (or parts), p_0, p_1, ..., p_N, of the form m = p_0 + p_1 + ... + p_N such that p_j = p_{N-j}, for each j in {0,...,N}. Two palindromic compositions, sum_{j=0..N} p_j and sum_{j=0..N} q_j (say), are identical if and only if p_j = q_j, j = 0,...,N; otherwise they are taken to be distinct.
%H Alois P. Heinz, <a href="/A233323/b233323.txt">Rows n = 1..141, flattened</a> (rows n = 1..50 from Charles R Greathouse IV)
%H V. E. Hoggatt, Jr., and Marjorie Bicknell, <a href="http://www.fq.math.ca/Scanned/13-4/hoggatt1.pdf">Palindromic compositions</a>, Fibonacci Quart., Vol. 13(4), 1975, pp. 350-356.
%e There are eight palindromic compositions of n=7, namely, {7}, {3,1,3}, {2,3,2}, {2,1,1,1,2}, {1,5,1}, {1,2,1,2,1}, {1,1,3,1,1}, {1,1,1,1,1,1,1}, and three of them have the largest part equal to 3, so T(7,3) = 3.
%e Triangle T(n,k) begins:
%e 1;
%e 1, 1;
%e 1, 0, 1,
%e 1, 2, 0, 1;
%e 1, 1, 1, 0, 1;
%e 1, 4, 1, 1, 0, 1;
%e 1, 2, 3, 0, 1, 0, 1;
%e 1, 7, 3, 3, 0, 1, 0, 1;
%e 1, 4, 6, 1, 2, 0, 1, 0, 1;
%e 1, 12, 7, 7, 1, 2, 0, 1, 0, 1;
%e ...
%p b:= proc(n, k) option remember; `if`(n<=k, 1, 0)+
%p add(b(n-2*j, k), j=1..min(k, iquo(n, 2)))
%p end:
%p T:= (n, k)-> b(n, k) -b(n, k-1):
%p seq(seq(T(n, k), k=1..n), n=1..14); # _Alois P. Heinz_, Dec 11 2013
%t b[n_, k_] := b[n, k] = If[n <= k, 1, 0] + Sum[b[n-2*j, k], { j, 1, Min[k, Quotient[n, 2]]}]; t[n_, k_] := b[n, k] - b[n, k-1]; Table[Table[t[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* _Jean-François Alcover_, Dec 13 2013, translated from _Alois P. Heinz_'s Maple code *)
%o (PARI) T(n,k,ok=0)={
%o if(n<1,return(n==0 && ok));
%o if(k>n/2 && !ok,
%o n-=k;
%o if(n<0||n%2, return(0));
%o return(2^max(n/2-1,0))
%o );
%o sum(i=1,k,
%o T(n-2*i,k,ok||i==k)
%o )+(n==k || (ok && n<k))
%o }; \\ _Charles R Greathouse IV_, Dec 11 2013
%Y Cf. A016116 (row sums), A233324 (row partial sums).
%Y T(n,2)+1 = A053602(n+1) = A123231(n). T(4n-2,2n) = A011782(n-1). - _Alois P. Heinz_, Dec 11 2013
%K nonn,tabl
%O 1,8
%A _L. Edson Jeffery_, Dec 10 2013