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.

A288887 Triangle read by rows: T(n,k) is the number of times k is a member of a sum-free subset of {1, ..., n} for 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 2, 4, 3, 5, 3, 7, 5, 7, 7, 5, 7, 8, 10, 8, 12, 8, 12, 13, 17, 13, 18, 16, 13, 17, 13, 23, 18, 25, 19, 28, 21, 30, 21, 40, 32, 43, 32, 47, 37, 29, 40, 29, 40, 45, 57, 45, 63, 43, 62, 44, 66, 45, 65, 72, 95, 71, 104, 70, 102, 85, 66, 95, 71, 89, 72, 132, 109, 139, 104, 142, 116
Offset: 1

Views

Author

Ben Burns, Jun 18 2017

Keywords

Examples

			For the nine sum-free subsets of {1,2,3,4}, 1 is a member of three of them, 2 is a member of two, 3 is a member of four, and 4 is a member of three, hence the 4th row is 3,2,4,3.
The triangle begins:
   1;
   1,  1;
   2,  2,  3;
   3,  2,  4,  3;
   5,  3,  7,  5,  7;
   7,  5,  7,  8, 10,  8;
  12,  8, 12, 13, 17, 13, 18;
  16, 13, 17, 13, 23, 18, 25, 19;
  ...
		

Crossrefs

Cf. A007865, A288888 (row sums).

Programs

  • PARI
    sumfree(v) = {for(i=1, #v, for (j=1, i, if (setsearch(v, v[i]+v[j]), return (0)););); return (1);}
    row(n) = {my(v = vector(n)); forsubset(n, s, if (sumfree(Set(s)), for (k=1, n, if (setsearch(Set(s), k), v[k]++);););); v;} \\ Michel Marcus, Nov 08 2020