login
A282516
Number T(n,k) of k-element subsets of [n] having a prime element sum; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
13
0, 0, 0, 0, 1, 1, 0, 2, 2, 0, 0, 2, 4, 1, 0, 0, 3, 5, 2, 2, 0, 0, 3, 7, 6, 4, 2, 0, 0, 4, 9, 10, 11, 7, 1, 0, 0, 4, 11, 18, 21, 13, 7, 2, 0, 0, 4, 14, 26, 34, 31, 20, 7, 3, 0, 0, 4, 18, 37, 53, 59, 51, 32, 11, 2, 0, 0, 5, 21, 47, 82, 110, 117, 85, 35, 12, 2, 0
OFFSET
0,8
LINKS
EXAMPLE
Triangle T(n,k) begins:
0;
0, 0;
0, 1, 1;
0, 2, 2, 0;
0, 2, 4, 1, 0;
0, 3, 5, 2, 2, 0;
0, 3, 7, 6, 4, 2, 0;
0, 4, 9, 10, 11, 7, 1, 0;
0, 4, 11, 18, 21, 13, 7, 2, 0;
0, 4, 14, 26, 34, 31, 20, 7, 3, 0;
0, 4, 18, 37, 53, 59, 51, 32, 11, 2, 0;
0, 5, 21, 47, 82, 110, 117, 85, 35, 12, 2, 0;
...
MAPLE
b:= proc(n, s) option remember; expand(`if`(n=0,
`if`(isprime(s), 1, 0), b(n-1, s)+x*b(n-1, s+n)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
seq(T(n), n=0..16);
MATHEMATICA
b[n_, s_] := b[n, s] = Expand[If[n==0, If[PrimeQ[s], 1, 0], b[n-1, s] + x*b[n-1, s+n]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, 0]];
Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Mar 21 2017, translated from Maple *)
CROSSREFS
Row sums give A127542.
Main diagonal gives A185012.
First lower diagonal gives A282518.
T(2n,n) gives A282517.
Sequence in context: A081417 A133388 A354643 * A158092 A145264 A300333
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Feb 17 2017
STATUS
approved