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.

A237450 Triangle read by rows, T(n,k) = !n + (k-1)*(n-1)!, with n>=1, 1<=k<=n; Position of the first n-letter permutation beginning with number k in the list of lexicographically sorted permutations A030299.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 16, 22, 28, 34, 58, 82, 106, 130, 154, 274, 394, 514, 634, 754, 874, 1594, 2314, 3034, 3754, 4474, 5194, 5914, 10954, 15994, 21034, 26074, 31114, 36154, 41194, 46234, 86554, 126874, 167194, 207514, 247834, 288154, 328474, 368794, 409114, 771994, 1134874, 1497754, 1860634, 2223514, 2586394, 2949274, 3312154, 3675034
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

When organized as a triangular table
1;
2, 3;
4, 6, 8;
10, 16, 22, 28;
34, 58, 82, 106, 130;
...
the k-th term of row n gives the position of the first n-letter permutation beginning with number k among all the lexicographically ordered permutations A030299. Thus the terms give the positions of rows of irregular table A237265 among the rows of A030298.
Note: the notation !n stands for the left factorial, A003422(n).

Crossrefs

Programs

  • Mathematica
    lf[n_] := lf[n] = (-1)^n n! Subfactorial[-n - 1] - Subfactorial[-1] // FullSimplify;
    T[n_, k_] := lf[n] + (k - 1)(n - 1)!;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten
  • Scheme
    (define (A237450 n) (+ (A003422 (A002024 n)) (* (A002262 (- n 1)) (A000142 (- (A002024 n) 1)))))

Formula

a(n) = A003422(A002024(n)) + (A002262(n-1)*A000142(A002024(n)-1)).