cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239829 Triangular array: T(n,k) = number of partitions of 2n - 1 that have alternating sum 2k - 1.

Original entry on oeis.org

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, 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, 1, 139, 227, 177, 110, 65, 36, 20, 10, 5, 2, 1, 195, 345, 282, 184
Offset: 1

Views

Author

Clark Kimberling, Mar 28 2014

Keywords

Comments

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).

Examples

			First nine rows:
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 .. 57 .. 36 .. 20 .. 10 .. 5 ... 2 ... 1
67 .. 92 .. 64 .. 36 .. 20 .. 10 .. 5 ... 2 ... 1
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.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `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)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(2*n-1$2, 1)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Mar 30 2014
  • Mathematica
    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}]
    TableForm[u]  (* A239829, array *)
    Flatten[u]    (* A239829, sequence *)
    (* Peter J. C. Moses, Mar 21 2014 *)
    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 *)