[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A233323 revision #20

A233323
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.
4
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, 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, 20, 16, 15, 3, 5, 0, 2, 0, 1, 0, 1
OFFSET
1,8
COMMENTS
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.
LINKS
Charles R Greathouse IV, Rows n = 1..50, flattened
EXAMPLE
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.
Triangle T(n,k) begins:
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, 0, 1;
1, 4, 6, 1, 2, 0, 1, 0, 1;
1, 12, 7, 7, 1, 2, 0, 1, 0, 1;
MAPLE
b:= proc(n, k) option remember; `if`(n<=k, 1, 0)+
add(b(n-2*j, k), j=1..min(k, iquo(n, 2)))
end:
T:= (n, k)-> b(n, k) -b(n, k-1):
seq(seq(T(n, k), k=1..n), n=1..14); # Alois P. Heinz, Dec 11 2013
MATHEMATICA
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 *)
PROG
(PARI) T(n, k, ok=0)={
if(n<1, return(n==0 && ok));
if(k>n/2 && !ok,
n-=k;
if(n<0||n%2, return(0));
return(2^max(n/2-1, 0))
);
sum(i=1, k,
T(n-2*i, k, ok||i==k)
)+(n==k || (ok && n<k))
}; \\ Charles R Greathouse IV, Dec 11 2013
CROSSREFS
Cf. A016116 (row sums), A233324 (row partial sums).
T(n,2)+1 = A053602(n+1) = A123231(n). T(4n-2,2n) = A011782(n-1). - Alois P. Heinz, Dec 11 2013
Sequence in context: A178798 A318277 A233321 * A115381 A115382 A112202
KEYWORD
nonn,tabl
AUTHOR
L. Edson Jeffery, Dec 10 2013
STATUS
approved