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”).
%I #17 Oct 27 2023 20:46:29
%S 1,2,1,4,2,1,7,5,2,1,12,10,5,2,1,19,19,10,5,2,1,30,33,20,10,5,2,1,45,
%T 57,36,20,10,5,2,1,67,92,64,36,20,10,5,2,1,97,147,107,65,36,20,10,5,2,
%U 1,139,227,177,110,65,36,20,10,5,2,1,195,345,282,184
%N Triangular array: T(n,k) = number of partitions of 2n - 1 that have alternating sum 2k - 1.
%C Suppose that p, with parts x(1) >= x(2) >= ... >= x(k), is a partition of n. Define AS(p), the alternating sum of p, by x(1) - x(2) + x(3) - ... + ((-1)^(k-1))*x(k); note that AS(p) has the same parity as n. Column 1 is given by T(n,1) = (number of partitions of 2n-1 having AS(p) = 1) = A000070(n) for n >= 1. Columns 2 and 3 are essentially A000098 and A103924, and the limiting column (after deleting initial 0's), A000712. The sum of numbers in row n is A000041(2n-1). The corresponding array for partitions into distinct parts is given by A152157 (defined as the number of partitions of 2n+1 into 2k+1 odd parts).
%H Alois P. Heinz, <a href="/A239829/b239829.txt">Rows n = 1..141, flattened</a> (first 20 rows from Clark Kimberling)
%e First nine rows:
%e 1
%e 2 ... 1
%e 4 ... 2 ... 1
%e 7 ... 5 ... 2 ... 1
%e 12 .. 10 .. 5 ... 2 ... 1
%e 19 .. 19 .. 10 .. 5 ... 2 ... 1
%e 30 .. 33 .. 20 .. 10 .. 5 ... 2 ... 1
%e 45 .. 57 .. 36 .. 20 .. 10 .. 5 ... 2 ... 1
%e 67 .. 92 .. 64 .. 36 .. 20 .. 10 .. 5 ... 2 ... 1
%e The partitions of 5 are 5, 41, 32, 311, 221, 2111, 11111, with respective alternating sums 5, 3, 1, 3, 1, 1, 1, so that row 2 of the array is 4 .. 2 .. 1.
%p b:= proc(n, i, t) option remember; `if`(n=0, x^(1/2), `if`(i<1, 0,
%p expand(b(n, i-1, t)+`if`(i>n, 0, b(n-i, i, -t)*x^((t*i)/2)))))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(2*n-1$2, 1)):
%p seq(T(n), n=1..14); # _Alois P. Heinz_, Mar 30 2014
%t z = 15; s[w_] := s[w] = Total[Take[#, ;; ;; 2]] - Total[Take[Rest[#], ;; ;; 2]] &[w]; c[n_] := c[n] = Table[s[IntegerPartitions[n][[k]]], {k, 1, PartitionsP[n]}]; t[n_, k_] := Count[c[2 n - 1], 2 k - 1]; u = Table[t[n, k], {n, 1, z}, {k, 1, n}]
%t TableForm[u] (* A239829, array *)
%t Flatten[u] (* A239829, sequence *)
%t (* _Peter J. C. Moses_, Mar 21 2014 *)
%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, x^(1/2), If[i<1, 0, Expand[b[n, i-1, t] + If[i>n, 0, b[n-i, i, -t]*x^((t*i)/2)]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][b[2n-1, 2n-1, 1]]; Table[T[n], {n, 1, 14}] // Flatten (* _Jean-François Alcover_, Aug 27 2016, after _Alois P. Heinz_ *)
%Y Cf. A239830, A239832, A239833.
%K nonn,tabl,easy
%O 1,2
%A _Clark Kimberling_, Mar 28 2014