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.

A242391 Number of compositions of n in which each part has odd multiplicity.

Original entry on oeis.org

1, 1, 1, 4, 3, 10, 16, 28, 49, 91, 186, 266, 670, 884, 2350, 3028, 8259, 10536, 30241, 37382, 108628, 135550, 391202, 503750, 1429838, 1884659, 5222976, 7107138, 19119324, 27088726, 70366026, 103884570, 259884905, 399686188, 962312254, 1543116240, 3576132805
Offset: 0

Views

Author

Alois P. Heinz, May 12 2014

Keywords

Examples

			a(0) = 1: the empty composition.
a(1) = 1: [1].
a(2) = 1: [2].
a(3) = 4: [3], [2,1], [1,2], [1,1,1].
a(4) = 3: [4], [3,1], [1,3].
a(5) = 10: [5], [4,1], [1,4], [3,2], [2,3], [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [1,1,1,1,1].
		

Crossrefs

Cf. A130495 (for even multiplicity).

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!,
          `if`(i<1, 0, add(`if`(j=0 or irem(j, 2)=1,
             b(n-i*j, i-1, p+j)/j!, 0), j=0..n/i)))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..45);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, Sum[If[j==0 || Mod[j, 2]==1, b[n-i*j, i-1, p+j]/j!, 0], {j, 0, n/i}]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Feb 08 2017, translated from Maple *)