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

A332721 Number of compositions of n^2 with parts <= n, such that each element of [n] is used at least once.

Original entry on oeis.org

1, 1, 3, 72, 5752, 1501620, 1171326960, 2571831080160, 15245263511750160, 236246829658682027760, 9325247205993698149853760, 917699267902161951609308035200, 221117091698491444413008381486903040, 128433050637127079872089064922773889126400
Offset: 0

Views

Author

Alois P. Heinz, Feb 21 2020

Keywords

Examples

			a(2) = 3: 112, 121, 211.
a(3) = 72: 111123, 111132, 111213, 111231, 111312, 111321, 112113, 112131, 112311, 113112, 113121, 113211, 121113, 121131, 121311, 123111, 131112, 131121, 131211, 132111, 211113, 211131, 211311, 213111, 231111, 311112, 311121, 311211, 312111, 321111, 11223, 11232, 11322, 12123, 12132, 12213, 12231, 12312, 12321, 13122, 13212, 13221, 21123, 21132, 21213, 21231, 21312, 21321, 22113, 22131, 22311, 23112, 23121, 23211, 31122, 31212, 31221, 32112, 32121, 32211, 1233, 1323, 1332, 2133, 2313, 2331, 3123, 3132, 3213, 3231, 3312, 3321.
		

Crossrefs

Programs

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

Formula

a(n) = A373118(n^2,n). - Alois P. Heinz, May 26 2024

A332796 Number of compositions of n^2 into parts >= n.

Original entry on oeis.org

1, 1, 2, 6, 26, 140, 882, 6349, 51284, 457704, 4459940, 47019819, 532485538, 6438774524, 82710138994, 1123798871990, 16090426592488, 241979954659728, 3811335657375786, 62712512310820402, 1075527196672980525, 19186234784992217621, 355349469934379290700
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2020

Keywords

Examples

			a(0) = 1: (), the empty composition.
a(1) = 1: 1.
a(2) = 2: 22, 4.
a(3) = 6: 333, 36, 63, 45, 54, 9.
a(4) = 26: 4444, 556, 565, 655, 466, 646, 664, 457, 475, 547, 574, 745, 754, 448, 484, 844, 88, 79, 97, 6(10), (10)6, 5(11), (11)5, 4(12), (12)4, (16).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n=0, 1,
          add(b(n-j, k), j=k..n))
        end:
    a:= n-> b(n^2, n):
    seq(a(n), n=0..23);
  • Mathematica
    b[n_, k_] := b[n, k] = If[n == 0, 1, Sum[b[n - j, k], {j, k, n}]];
    a[n_] := b[n^2, n];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Mar 04 2022, after Alois P. Heinz *)

A332747 Number of compositions of n^2, such that each element of [n] is used at least once as a part.

Original entry on oeis.org

1, 1, 3, 72, 6232, 1621620, 1241237520, 2675188471920, 15634073104902000, 239929277724680059440, 9411787539302194544158080, 922671287397731617736789070720, 221805878984619105095368813189002240, 128660270226206951104782827202740054476800
Offset: 0

Views

Author

Alois P. Heinz, Feb 21 2020

Keywords

Comments

Some parts can be larger than n. Adding the condition that parts cannot be larger than n, we get A332721. Removing from A332721 the condition that each element of [n] has to be used, we get A332716.

Examples

			a(4) = 6232: all permutations of 4321111111, 432211111, 43222111, 4322221, 43321111, 4332211, 433321, 4432111, 443221, 543211, 64321.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p, m) option remember; `if`(n=0, p!,
          `if`(i<1, 0, (t-> add(b(n-i*j, i-1, p+j, t)/(j+
          `if`(t=0, 1, 0))!, j=0..n/i))(`if`(i>m, m, 0))))
        end:
    a:= n-> b(n*(n-1)/2$2, n$2):
    seq(a(n), n=0..15);
  • Mathematica
    b[n_, i_, p_, m_] := b[n, i, p, m] = If[n == 0, p!,
         If[i < 1, 0, Function[t, [b[n - i*j, i - 1, p + j, t]/(j +
         If[t == 0, 1, 0])!, {j, 0, n/i}]][If[i > m, m, 0]]]];
    a[n_] := b[n(n-1)/2, n(n-1)/2, n, n];
    Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Sep 08 2021, after Alois P. Heinz *)
Showing 1-3 of 3 results.