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.
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
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; ...
Links
- Fausto A. C. Cariboni, Rows n = 0..80, flattened (rows n = 0..40 from Alois P. Heinz)
- Eric Weisstein's World of Mathematics, Nonaveraging Sequence
- Wikipedia, Arithmetic progression
- Wikipedia, Salem-Spencer set
- Index entries related to non-averaging sequences
Crossrefs
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 *)
Comments