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.

A339033 Triangle read by rows, T(n, k) for 0 <= k <= n. T(n, 0) = 0^n; T(n, n) = n!; otherwise T(n, k) = (n + 1 - k)*(k - 1)!.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 3, 2, 6, 0, 4, 3, 4, 24, 0, 5, 4, 6, 12, 120, 0, 6, 5, 8, 18, 48, 720, 0, 7, 6, 10, 24, 72, 240, 5040, 0, 8, 7, 12, 30, 96, 360, 1440, 40320, 0, 9, 8, 14, 36, 120, 480, 2160, 10080, 362880, 0, 10, 9, 16, 42, 144, 600, 2880, 15120, 80640, 3628800
Offset: 0

Views

Author

Peter Luschny, Nov 20 2020

Keywords

Comments

Related to the multinomial that is called M2 in Abramowitz and Stegun, p. 831.

Examples

			Triangle starts:
0: [1]
1: [0, 1]
2: [0, 2, 2]
3: [0, 3, 2,  6]
4: [0, 4, 3,  4, 24]
5: [0, 5, 4,  6, 12, 120]
6: [0, 6, 5,  8, 18,  48, 720]
7: [0, 7, 6, 10, 24,  72, 240, 5040]
8: [0, 8, 7, 12, 30,  96, 360, 1440, 40320]
9: [0, 9, 8, 14, 36, 120, 480, 2160, 10080, 362880]
		

Crossrefs

Cf. A339034 (row sums), A092271.

Programs

  • Mathematica
    A339033[n_, k_] := Which[k == 0, Boole[n == 0], n == k, n!, True, (n+1-k)*(k-1)!];
    Table[A339033[n, k], {n, 0, 10}, {k, 0, n}] (* Paolo Xausa, Jan 31 2024 *)
  • SageMath
    def  A339033(n, k):
        if k == 0: return 0^n
        if n == k: return factorial(n)
        return (n + 1 - k)*factorial(k - 1)
    for n in (0..10): print([A339033(n, k) for k in (0..n)])
    def A339033Row(n):
        S = [0^n]
        for k in range(n, 0, -1):
            for p in Partitions(n, max_part=k, inner=[k], length=n+1-k):
                S.append(p.aut())
        return S
    for n in (0..10): print(A339033Row(n))

Formula

T(n, k) = n! / A092271(n, k) for k > 0.