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.

A335357 Number of compositions of n such that every subsequence has a different sum.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 5, 13, 13, 27, 21, 41, 41, 61, 55, 111, 105, 185, 155, 313, 259, 495, 387, 701, 623, 961, 805, 1419, 1191, 1781, 1481, 2437, 2161, 3387, 2745, 4457, 3965, 5821, 4867, 8223, 6909, 10625, 8591, 14617, 11887, 18735, 14991, 24821, 20291, 32113
Offset: 0

Views

Author

Alois P. Heinz, Jun 03 2020

Keywords

Comments

All terms are odd.

Examples

			a(7) = 13: 7, 16, 25, 34, 43, 52, 61, 124, 142, 214, 241, 412, 421.
a(8) = 13: 8, 17, 26, 35, 53, 62, 71, 125, 152, 215, 251, 512, 521.
a(9) = 27: 9, 18, 27, 36, 45, 54, 63, 72, 81, 126, 135, 153, 162, 216, 234, 243, 261, 315, 324, 342, 351, 423, 432, 513, 531, 612, 621.
a(10) = 21: 10, 19, 28, 37, 46, 64, 73, 82, 91, 127, 136, 163, 172, 217, 271, 316, 361, 613, 631, 712, 721.
		

Crossrefs

Cf. A032020, A275972 (the same for partitions).

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, 1, add((h-> `if`(nops(s)*
          2=nops(h), b(n-j, h), 0))({s[], map(x-> x+j, s)[]}), j=1..n))
        end:
    a:= n-> b(n, {0}):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, s_] := b[n, s] = If[n == 0, 1, Sum[Function[h, If[Length[s]*
         2 == Length[h], b[n - j, h], 0]][Union@Join[s, s + j]], {j, 1, n}]];
    a[n_] := b[n, {0}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 13 2022, after Alois P. Heinz *)