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.

A224344 Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
Offset: 0

Views

Author

Alois P. Heinz, May 23 2013

Keywords

Examples

			A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
   1;
   1;
   1,   1;
   1,   3;
   2,   5,   1;
   3,   8,   5;
   5,  13,  13,   1;
   7,  23,  27,   7;
  11,  39,  52,  25,   1;
  17,  65,  99,  66,   9;
  27, 106, 186, 151,  41,  1;
  40, 177, 340, 323, 133, 11;
  ...
		

Crossrefs

Column k=0 gives: A052284.
Row sums are: A011782.
Row lengths are: A008619.
T(floor(n/2)) = A093178(n).
T(2n,n-1) = A001844(n-1) for n>0.

Programs

  • Maple
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)->x+y, %,
          [`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
        end:
    seq(T(n), n=0..16);
  • Mathematica
    zip[f_, x_List, y_List, z_] :=  With[{m = Max[Length[x], Length[y]]},  Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] =  Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)

Formula

Sum_{k=1..floor(n/2)} k * T(n,k) = A102291(n).