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-4 of 4 results.

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 *)

A322132 Number of compositions of n that can be rearranged into a palindrome.

Original entry on oeis.org

1, 1, 2, 2, 6, 8, 18, 26, 56, 90, 202, 320, 730, 1154, 2592, 4130, 9522, 15208, 35330, 56746, 131352, 212074, 492570, 795920, 1855706, 3006482, 7016464, 11406930, 26635154, 43409752, 101387602, 165798282, 386965208, 635250986, 1480773866, 2439516656, 5678477866
Offset: 0

Views

Author

Andrew Howroyd, Nov 27 2018

Keywords

Comments

Equivalently, the number of compositions of n with at most one part size having odd multiplicity.

Examples

			Case n=4: The 6 compositions are: 4, 211, 121, 112, 22, 1111.
Case n=5: The 8 compositions are: 5, 311, 131, 113, 122, 212, 221, 11111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p, t) option remember; `if`(n=0 or i=1,
          `if`(t and n::odd, 0, (n+p)!/n!), add(`if`(t and j::odd,
           0, b(n-i*j, i-1, p+j, t or j::odd))/j!, j=0..n/i))
        end:
    a:= n-> b(n$2, 0, false):
    seq(a(n), n=0..40);  # Alois P. Heinz, Dec 02 2018
  • Mathematica
    b[n_, i_, p_, t_] := b[n, i, p, t] = If[n == 0 || i == 1, If[t && OddQ[n], 0, (n+p)!/n!], Sum[If[t && OddQ[j], 0, b[n-i*j, i-1, p+j, t || OddQ[j]]]/ j!, {j, 0, n/i}]];
    a[n_] := b[n, n, 0, False];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 13 2019, after Alois P. Heinz *)
  • PARI
    a(n)={sum(k=0, n\2, my(p=prod(i=1, k, 1 + sum(j=1, k\i, x^(i*j)*y^(2*j)/(2*j + (i==n-2*k))!) + O(x*x^k))); subst(serlaplace(polcoef(p,k)*y^(2*k
    				

A322326 Number of compositions of n in which at most one part has even multiplicity.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 26, 64, 107, 226, 382, 859, 1488, 3124, 5628, 11326, 21629, 42274, 81420, 158002, 309129, 592798, 1181109, 2234319, 4501108, 8461706, 17211219, 32187953, 66018320, 122792362, 253549269, 469715744, 975300728, 1802165555, 3758679309, 6931995005
Offset: 0

Views

Author

Alois P. Heinz, Dec 03 2018

Keywords

Examples

			a(6) = 26: 111111, 11112, 11121, 11211, 12111, 21111, 222, 1113, 1131, 1311, 3111, 123, 132, 213, 231, 312, 321, 33, 114, 141, 411, 24, 42, 15, 51, 6.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p, t) option remember; `if`(n=0 or i=1, `if`(n>0 and
           t and n::even, 0, (n+p)!/n!), b(n, i-1, p, t)+add(`if`(t and
           j::even, 0, b(n-i*j, i-1, p+j, t or j::even))/j!, j=1..n/i))
        end:
    a:= n-> b(n$2, 0, false):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, i_, p_, t_] := b[n, i, p, t] = If[n == 0 || i == 1, If[n > 0 &&
         t && EvenQ[n], 0, (n + p)!/n!], b[n, i - 1, p, t] + Sum[If[t &&
         EvenQ[j], 0, b[n - i*j, i-1, p+j, t || EvenQ[j]]]/j!, {j, 1, n/i}]];
    a[n_] := b[n, n, 0, False];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 05 2022, after Alois P. Heinz *)

A130494 Row sums of triangle A130478.

Original entry on oeis.org

1, 4, 11, 37, 163, 907, 6067, 47107, 415027, 4084147, 44363827, 526994227, 6793931827, 94451224627, 1408352613427, 22418320792627, 379413423256627, 6802709918872627, 128803497755800627, 2568107879638168627, 53780695151756440627, 1180214324937540760627
Offset: 1

Views

Author

Gary W. Adamson, May 31 2007

Keywords

Examples

			a(5) = 163 sum of row 5 terms of triangle A130478: (120 + 30 + 8 + 3 + 2); where (30, 8, 3, 2) = the first 4 reversed terms of A001048.
a(5) = 163 = 5! + A130495(4) = 120 + 43.
a(5) = 163 = 5! + (4! + 3!) + (3! + 2!) + (2! + 1!) + (1! + 1).
		

Crossrefs

Formula

Row sums of triangle A130478. a(1) = 1; a(n), n>1 = n! + A130495(n-1). a(n) = n! + ((n-1)! + (n-2)!) + ((n-2)! + (n-3)!) + ... + (1! + 1). a(n) = n! + sum of first (n-1) terms of A001048 in reverse, where A001048 = (2, 3, 8, 30, 144, ...).

Extensions

More terms from Alois P. Heinz, Dec 02 2018
Showing 1-4 of 4 results.