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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 4, 6, 2, 1, 5, 10, 6, 1, 1, 6, 15, 14, 4, 1, 7, 21, 26, 10, 1, 8, 28, 44, 25, 1, 9, 36, 68, 51, 4, 1, 10, 45, 100, 98, 24, 1, 11, 55, 140, 165, 64, 7, 1, 12, 66, 190, 267, 144, 25, 1, 13, 78, 250, 407, 284, 78, 6, 1, 14, 91, 322, 601, 520, 188, 22, 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

			Triangle T(n,k) begins:
  1;
  1,  1;
  1,  2,   1;
  1,  3,   3;
  1,  4,   6,   2;
  1,  5,  10,   6,    1;
  1,  6,  15,  14,    4;
  1,  7,  21,  26,   10;
  1,  8,  28,  44,   25;
  1,  9,  36,  68,   51,    4;
  1, 10,  45, 100,   98,   24;
  1, 11,  55, 140,  165,   64,   7;
  1, 12,  66, 190,  267,  144,  25;
  1, 13,  78, 250,  407,  284,  78,   6;
  1, 14,  91, 322,  601,  520, 188,  22,  1;
  1, 15, 105, 406,  849,  862, 386,  64,  4;
  1, 16, 120, 504, 1175, 1394, 763, 164, 14;
  ...
		

Crossrefs

Columns k=0-4 give: A000012, A000027, A000217(n-1), A212964(n-1), A300760.
Row sums give A051013.
Last elements of rows give A262347.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, 1, 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)))(b(n, {})):
    seq(T(n), n=0..16);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0, 1, b[n-1, s] + If[AnyTrue[s, MemberQ[s, 2 # - n]&], 0, Expand[x b[n-1, s ~Union~ {n}]]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, {}]];
    T /@ Range[0, 16] // Flatten (* Jean-François Alcover, May 30 2020, after Maple *)

Formula

T(n,k) = Sum_{j=0..n} A334892(j,k).
T(n,A003002(n)) = A262347(n).

A334893 Number of subsets of [n] avoiding 3-term arithmetic progressions and containing n if n>0.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 17, 25, 41, 63, 109, 165, 262, 412, 643, 932, 1459, 2163, 3212, 4601, 6817, 9904, 14741, 20906, 30352, 43993, 63540, 89442, 132037, 187587, 266842, 378061, 535907, 751709, 1077809, 1499972, 2084027, 2951390, 4114165, 5651914, 7968177
Offset: 0

Views

Author

Alois P. Heinz, May 14 2020

Keywords

Crossrefs

Row sums of A334892.
Partial sums give A051013.

Programs

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

A334894 Number of maximal subsets of [n] avoiding 3-term arithmetic progressions and containing n if n>0.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 6, 15, 4, 20, 7, 18, 6, 1, 3, 10, 29, 54, 123, 2, 16, 44, 170, 2, 31, 2, 10, 24, 70, 1, 10, 2, 2, 10, 26, 2, 2, 82, 221, 20, 1, 3, 10, 27, 58, 167, 408, 831, 2005, 4216, 14, 36, 106, 2, 6, 18, 30, 2, 2, 2, 8, 34, 2, 2, 4, 8, 12, 80, 211
Offset: 0

Views

Author

Alois P. Heinz, May 14 2020

Keywords

Crossrefs

Last elements of rows of A334892.

Formula

a(n) = A262347(n) - [n > 0 and A003002(n) = A003002(n-1)] * A262347(n-1).
a(n) = A334892(n,A003002(n)).
a(n) = A334187(n,A003002(n)) - [n > 0] * A334187(n-1,A003002(n)).
Showing 1-3 of 3 results.