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.

A334892 Number T(n,k) of k-element subsets of [n] avoiding 3-term arithmetic progressions and containing n if n>0; triangle T(n,k), n>=0, 0<=k<=A003002(n), read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 1, 3, 2, 0, 1, 4, 4, 1, 0, 1, 5, 8, 3, 0, 1, 6, 12, 6, 0, 1, 7, 18, 15, 0, 1, 8, 24, 26, 4, 0, 1, 9, 32, 47, 20, 0, 1, 10, 40, 67, 40, 7, 0, 1, 11, 50, 102, 80, 18, 0, 1, 12, 60, 140, 140, 53, 6, 0, 1, 13, 72, 194, 236, 110, 16, 1
Offset: 0

Views

Author

Alois P. Heinz, May 14 2020

Keywords

Comments

T(n,k) is defined for all n >= 0 and k >= 0. The triangle contains only elements with 0 <= k <= A003002(n). T(n,k) = 0 for k > A003002(n).

Examples

			  1;
  0, 1;
  0, 1,  1;
  0, 1,  2;
  0, 1,  3,  2;
  0, 1,  4,  4,   1;
  0, 1,  5,  8,   3;
  0, 1,  6, 12,   6;
  0, 1,  7, 18,  15;
  0, 1,  8, 24,  26,   4;
  0, 1,  9, 32,  47,  20;
  0, 1, 10, 40,  67,  40,   7;
  0, 1, 11, 50, 102,  80,  18;
  0, 1, 12, 60, 140, 140,  53,   6;
  0, 1, 13, 72, 194, 236, 110,  16,  1;
  0, 1, 14, 84, 248, 342, 198,  42,  3;
  0, 1, 15, 98, 326, 532, 377, 100, 10;
  ...
		

Crossrefs

Columns k=0-3 give: A000007, A057427, A000027(n-1), A007590(n-2).
Row sums give A334893.
Last elements of rows give A334894.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, x, b(n-1, s)+ `if`(
          ormap(j-> 2*j-n in s, s), 0, expand(x*b(n-1, s union {n}))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
                `if`(n=0, 1, b(n-1, {n}))):
    seq(T(n), n=0..16);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0, x, b[n-1, s] + If[
         AnyTrue[s, MemberQ[s, 2#-n]&], 0, Expand[x*b[n-1, s ~Union~ {n}]]]];
    T[n_] := If[n == 0, {1}, CoefficientList[b[n-1, {n}], x]];
    T /@ Range[0, 16] // Flatten (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)

Formula

T(0,k) = A334187(0,k), T(n,k) = A334187(n,k) - A334187(n-1,k) for n > 0.