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.

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

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 4, 6, 6, 1, 8, 18, 24, 24, 1, 16, 54, 96, 120, 120, 1, 32, 162, 384, 600, 720, 720, 1, 64, 486, 1536, 3000, 4320, 5040, 5040, 1, 128, 1458, 6144, 15000, 25920, 35280, 40320, 40320, 1, 256, 4374, 24576, 75000, 155520, 246960, 322560, 362880, 362880
Offset: 0

Views

Author

Peter Luschny, Mar 01 2018

Keywords

Comments

With offset 1, T(n,k) is the number of permutations of [n] in which all entries left of 1 (if any) are excedances and 1 is in position n+1-k. An excedance of a permutation p is an entry p(i) such that p(i)>i. For example, T(4,2) = 4 counts 2314, 2413, 3412, 4312. - David Callan, Dec 12 2021

Examples

			Triangle starts:
[0] 1
[1] 1,   1
[2] 1,   2,    2
[3] 1,   4,    6,     6
[4] 1,   8,   18,    24,    24
[5] 1,  16,   54,    96,   120,    120
[6] 1,  32,  162,   384,   600,    720,    720
[7] 1,  64,  486,  1536,  3000,   4320,   5040,   5040
[8] 1, 128, 1458,  6144, 15000,  25920,  35280,  40320,  40320
[9] 1, 256, 4374, 24576, 75000, 155520, 246960, 322560, 362880, 362880
		

Programs

  • Magma
    [(k+1)^(n-k)*Factorial(k): k in [0..n], n in [0..10]]; // G. C. Greubel, Nov 08 2018
  • Maple
    T := (n,k) -> (k+1)^(n-k)*k!: seq(seq(T(n,k), k=0..n), n=0..9);
  • Mathematica
    Table[(k+1)^(n-k)*k!, {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 08 2018 *)
  • PARI
    T(n,k) = {(k+1)^(n-k)*k!}
    for(n=0, 10, for(k=0, n, print1(T(n, k), ", ")); print); \\ Andrew Howroyd, Nov 08 2018
    
  • Python
    from sympy import factorial
    def T(n, k): return (k+1)**(n-k)*factorial(k)
    for n in range(21): print([T(n, k) for k in range(n+1)]) # Indranil Ghosh, Mar 02 2018