A245693 Number T(n,k) of permutations on [n] that are self-inverse on [k] but not on [k+1]; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
1, 0, 1, 0, 0, 2, 2, 0, 0, 4, 12, 2, 0, 0, 10, 72, 18, 4, 0, 0, 26, 480, 120, 36, 8, 0, 0, 76, 3600, 840, 264, 84, 20, 0, 0, 232, 30240, 6480, 1920, 648, 216, 52, 0, 0, 764, 282240, 55440, 15120, 4920, 1776, 612, 152, 0, 0, 2620, 2903040, 524160, 131040, 39600, 13920, 5232, 1848, 464, 0, 0, 9496
Offset: 0
A333371 Exponential convolution of primorial numbers (A002110) with themselves.
1, 4, 20, 132, 1116, 12420, 171300, 2884980, 56674380, 1289511300, 34769949060, 1063909626780, 37255008811020, 1470406699982220, 63114539746598340, 2936218980067393020, 150241360192861037100, 8497891914008911514100, 514514062115556069627060
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..350
- Eric Weisstein's World of Mathematics, Primorial
- Index entries for sequences related to primorial numbers
Programs
-
Maple
p:= proc(n) option remember; `if`(n<1, 1, ithprime(n)*p(n-1)) end: a:= n-> add(p(i)*p(n-i)*binomial(n, i), i=0..n): seq(a(n), n=0..20); # Alois P. Heinz, Mar 17 2020
-
Mathematica
primorial[n_] := Product[Prime[k], {k, 1, n}]; a[n_] := Sum[Binomial[n, k] primorial[k] primorial[n - k], {k, 0, n}]; Table[a[n], {n, 0, 18}]
Formula
E.g.f.: (Sum_{k>=0} prime(k)# * x^k / k!)^2, where prime()# = A002110.
a(n) = Sum_{k=0..n} binomial(n,k) * prime(k)# * prime(n-k)#.
A350297 Triangle read by rows: T(n,k) = n!*(n-1)^k/k!.
1, 1, 0, 2, 2, 1, 6, 12, 12, 8, 24, 72, 108, 108, 81, 120, 480, 960, 1280, 1280, 1024, 720, 3600, 9000, 15000, 18750, 18750, 15625, 5040, 30240, 90720, 181440, 272160, 326592, 326592, 279936, 40320, 282240, 987840, 2304960, 4033680, 5647152, 6588344, 6588344, 5764801
Offset: 0
Comments
Rows n >= 2 are coefficients in a double summation power series for the integral of x^(1/x), and the integral of its inverse function y^(y^(y^(y^(...)))). See A350358.
Examples
Triangle T(n,k) begins: ----------------------------------------------------------------- n\k 0 1 2 3 4 5 6 7 ----------------------------------------------------------------- 0 | 1, 1 | 1, 0, 2 | 2, 2, 1, 3 | 6, 12, 12, 8, 4 | 24, 72, 108, 108, 81, 5 | 120, 480, 960, 1280, 1280, 1024, 6 | 720, 3600, 9000, 15000, 18750, 18750, 15625, 7 | 5040, 30240, 90720, 181440, 272160, 326592, 326592, 279936. ...
Crossrefs
Programs
-
Maple
T := (n, k) -> (n!/k!)*(n - 1)^k: seq(seq(T(n, k), k = 0..n), n = 0..8); # Peter Luschny, Dec 24 2021
-
Mathematica
T[1, 0] := 1; T[n_, k_] := n!*(n - 1)^k/k!; Table[T[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Amiram Eldar, Dec 24 2021 *)
Formula
T(n, k) = binomial(n, k)*A350269(n, k). - Peter Luschny, Dec 25 2021
A018931 The number of permutations of n cards in which 2 is the first card hit and 3 the next hit after 2.
0, 1, 2, 12, 72, 480, 3600, 30240, 282240, 2903040, 32659200, 399168000, 5269017600, 74724249600, 1133317785600, 18307441152000, 313841848320000, 5690998849536000, 108840352997376000, 2189611807358976000, 46225138155356160000, 1021818843434188800000
Offset: 3
Keywords
Comments
From the game of Mousetrap.
References
- Daniel J. Mundfrom, A problem in permutations: the game of "Mousetrap". European J. Combin. 15 (1994), no. 6, 555-560.
Links
- D. J. Mundfrom, A problem of permutations: the Game of "Mousetrap", Eur. J. Combinat. 15 (1994) 555-560, Table 1.
Crossrefs
Cf. A002468.
Formula
a(n) = A062119(n-3), n > 4. - R. J. Mathar, Oct 02 2008
Extensions
Offset changed to 3 and more precise definition provided by R. J. Mathar, Oct 02 2008
A120928 Number of "ups" and "downs" in the permutations of [n] if either a previous counted "up" ("down") or a "void" precedes an "up" ("down") which then will be counted also.
2, 8, 44, 280, 2040, 16800, 154560, 1572480, 17539200, 212889600, 2794176000, 39437798400, 595718323200, 9589612032000, 163895187456000, 2964061900800000, 56554301067264000, 1135354270482432000, 23923536413736960000, 527939735774330880000
Offset: 2
Comments
An "up" ("down") is a neighboring pair of elements e_i, e_j of [n] with e_i < e_j (e_i > e_j). A "void" is a missing preceding pair, i.e., the start of [n]. We discuss two examples for [n=4]. In the permutation [3, 1, 2, 4] "void" precedes the pair 3,1 and consequently a "down" is counted. No "up" which has been counted precedes the "ups" 1,2 and 2,4 so they are not counted. In [3, 4, 1, 2] the "up" 3,4 is counted and so is the next "up" 1,2 but the down 4,1 has no preceding "down" registered and is therefore not counted.
Examples
[1, 2, 3, 4], "ups"=3, "downs"=0; [1, 2, 4, 3], "ups"=2, "downs"=0; [1, 3, 2, 4], "ups"=2, "downs"=0; [1, 3, 4, 2], "ups"=2, "downs"=0; [1, 4, 2, 3], "ups"=2, "downs"=0; [1, 4, 3, 2], "ups"=1, "downs"=0; [2, 1, 3, 4], "ups"=0, "downs"=1; [2, 1, 4, 3], "ups"=0, "downs"=2; [2, 3, 1, 4], "ups"=2, "downs"=0; [2, 3, 4, 1], "ups"=2, "downs"=0; [2, 4, 1, 3], "ups"=2, "downs"=0; [2, 4, 3, 1], "ups"=1, "downs"=0; [3, 1, 2, 4], "ups"=0, "downs"=1; [3, 1, 4, 2], "ups"=0, "downs"=2; [3, 2, 1, 4], "ups"=0, "downs"=2; [3, 2, 4, 1], "ups"=0, "downs"=2; [3, 4, 1, 2], "ups"=2, "downs"=0; [3, 4, 2, 1], "ups"=1, "downs"=0; [4, 1, 2, 3], "ups"=0, "downs"=1; [4, 1, 3, 2], "ups"=0, "downs"=2; [4, 2, 1, 3], "ups"=0, "downs"=2; [4, 2, 3, 1], "ups"=0, "downs"=2; [4, 3, 1, 2], "ups"=0, "downs"=2; [4, 3, 2, 1], "ups"=0, "downs"=3.
Links
- Alois P. Heinz, Table of n, a(n) for n = 2..400
Programs
-
Maple
a:= n-> ceil(n!*(3*n-1)/6): seq(a(n), n=2..30); # Alois P. Heinz, Apr 21 2012
Formula
E.g.f.: -(6+6*x^2-4*x^3+x^4)/(-3+12*x-18*x^2+12*x^3-3*x^4). - Thomas Wieder, May 02 2009
a(2) = 2, a(n) = n! * (3*n - 1) / 6 for n > 2. - Jon E. Schoenfield, Apr 18 2010
Extensions
4 more terms from R. J. Mathar, Aug 25 2008
More terms from Alois P. Heinz, Apr 21 2012
A132431 For n>0, let B_n be the subsemigroup of the full transformation monoid on the n-set [n] generated by the following functions: Let x be a certain element in [n]. Now the generators of B are those functions which map either x to any distinct element y in [n] leaving all the other elements fixed, or y to x leaving all the other elements fixed. Then a(n) = number of elements in B_n.
0, 2, 9, 88, 1385, 24336, 466753, 9906688, 233522577, 6093136000, 174912502721, 5487091383456, 186891076515481, 6870622015481056, 271195480556337345, 11440127985767481856, 513639921634424850977, 24455974520989478444544, 1230835712617872016215265
Offset: 1
Comments
Let b(n)=n^n be the cardinality of the full transformation monoid. The sequence of quotients a(n)/b(n) converges to 1-1/e.
References
- S. Bogner, Eine Praesentation der Halbgruppe der singularen zyklisch-monotonen Abbildungen UND eine von Idempotenten erzeugte Unterhalbgruppe von T_n (Studienarbeit in Informatik, Advisor: Klaus Leeb), Friedrich-Alexander-Universitaet Erlangen-Nuernberg, 2007.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..250
Programs
-
Haskell
a132431 n = a060226 n - a062119 n + a002378 (n - 1) -- Reinhard Zumkeller, Aug 27 2012
-
Mathematica
Join[{0},Table[n^n-n (n-1)^(n-1)-(n-1)n!+n(n-1),{n,2,20}]] (* Harvey P. Dale, Jun 07 2018 *)
Formula
a(n) = n^n - n*(n-1)^(n-1) - (n-1)*n! + n*(n-1).
a(n) = n*(n-1) + Sum_{k=1..n-2} k*Stirling2(n-1,k)*k!*C(n,k).
A182062 T(n,k) = C(n+1-k,k)*k!*(n-k)!, the number of ways for k men and n-k women to form a queue in which no man is next to another man.
1, 1, 1, 2, 2, 0, 6, 6, 2, 0, 24, 24, 12, 0, 0, 120, 120, 72, 12, 0, 0, 720, 720, 480, 144, 0, 0, 0, 5040, 5040, 3600, 1440, 144, 0, 0, 0, 40320, 40320, 30240, 14400, 2880, 0, 0, 0, 0, 362880, 362880, 282240, 151200, 43200, 2880, 0, 0, 0, 0, 3628800, 3628800
Offset: 0
Comments
Triangle T(n,k), 0<=k<=n, is readily derived since there are C(n+1-k,k) ways to form a sequence of k zeros and n-k ones in which no zeros are consecutive and there are k!(n-k)! ways to permute k labeled zeros and n-k labeled ones. This triangle contains several known sequences, notably A000142 (factorial numbers), A062119 (number of multiplications performed in a determinant), and A010796.
Examples
T(4,2)=12 since there are 12 ways to line up two men {M,m} and two women {W,w} so that no man is next to another man, namely, MWmw, MWwm, MwmW, MwWm, mWMw, mWwM, mwMW, mwWM, WMwm, WmwM, wMWm, and wmWM. Triangle T(n,k) begins 1, 1, 1, 2, 2, 0, 6, 6, 2, 0, 24, 24, 12, 0, 0, 120, 120, 72, 12, 0, 0, 720, 720, 480, 144, 0, 0, 0, 5040, 5040, 3600, 1440, 144, 0, 0, 0, 40320, 40320, 30240, 14400, 2880, 0, 0, 0, 0, 362880,362880,282240,151200,43200,2880,0,0,0,0, 3628800,3628800,2903040,1693440,604800,86400,0,0,0,0,0
Links
- T. D. Noe, Rows n = 0..100, flattened
- Dennis Walsh, Notes on isolating men in a line-up [dead link]
Programs
-
Maple
seq(seq(binomial(n+1-k,k)*k!*(n-k)!,k=0..n),n=0..10);
-
Mathematica
Flatten[Table[Binomial[n+1-k,k]k!(n-k)!,{n,0,10},{k,0,n}]] (* Harvey P. Dale, Jul 15 2012 *)
Formula
binomial(n+1-k,k)*k!*(n-k)!
G.f. (fixed k): (1-k)*hypergeom([1, 1-k, 2-k],[2-2*k],t)*GAMMA(1-k)^2/GAMMA(2-2*k)
T(n,k)=(n+2-2k)*T(n-1,k-1)
A249631 Number of permutations p of {1,...,n} such that |p(i+1)-p(i)| < k, k=2,...,n; T(n,k), read by rows.
2, 2, 6, 2, 12, 24, 2, 20, 72, 120, 2, 34, 180, 480, 720, 2, 56, 428, 1632, 3600, 5040, 2, 88, 1042, 5124, 15600, 30240, 40320, 2, 136, 2512, 15860, 61872, 159840, 282240, 362880, 2, 208, 5912, 50186, 236388, 773040, 1764000, 2903040, 3628800
Offset: 2
Examples
Triangle starts with n=2: 2; 2, 6; 2, 12, 24; 2, 20, 72, 120; 2, 34, 180, 480, 720;
Links
- Li-yao Xia, Triangle of T(n,k) for n=2..10, k=2..n
Crossrefs
Programs
-
Haskell
a n x = filter (\l -> all (< x) (zipWith (\x y -> abs (x - y)) l (tail l))) (permutations [1 .. n])
-
PARI
isokp(perm, k) = {for (i=1, #perm-1, if (abs(perm[i]-perm[i+1]) >= k, return (0));); return (1);} tabl(nn) = {for (n=2, nn, for (k=2, n, print1(sum(i=1, n!, isokp(numtoperm(n, i), k)), ", ");); print(););} \\ Michel Marcus, Nov 06 2014
A361893 Triangle read by rows. T(n, k) = n! * binomial(n - 1, k - 1) / (n - k)!.
1, 0, 1, 0, 2, 2, 0, 3, 12, 6, 0, 4, 36, 72, 24, 0, 5, 80, 360, 480, 120, 0, 6, 150, 1200, 3600, 3600, 720, 0, 7, 252, 3150, 16800, 37800, 30240, 5040, 0, 8, 392, 7056, 58800, 235200, 423360, 282240, 40320, 0, 9, 576, 14112, 169344, 1058400, 3386880, 5080320, 2903040, 362880
Offset: 0
Examples
Triangle T(n, k) starts: [0] 1; [1] 0, 1; [2] 0, 2, 2; [3] 0, 3, 12, 6; [4] 0, 4, 36, 72, 24; [5] 0, 5, 80, 360, 480, 120; [6] 0, 6, 150, 1200, 3600, 3600, 720; [7] 0, 7, 252, 3150, 16800, 37800, 30240, 5040; [8] 0, 8, 392, 7056, 58800, 235200, 423360, 282240, 40320; [9] 0, 9, 576, 14112, 169344, 1058400, 3386880, 5080320, 2903040, 362880;
Crossrefs
Programs
-
Maple
A361893 := (n, k) -> n!*binomial(n - 1, k - 1)/(n - k)!: seq(seq(A361893(n,k), k = 0..n), n = 0..9); # Using the egf.: egf := 1 + (x*y/(1 - x*y))*exp(y/(1 - x*y)): ser := series(egf, y, 10): poly := n -> convert(n!*expand(coeff(ser, y, n)), polynom): row := n -> seq(coeff(poly(n), x, k), k = 0..n): seq(print(row(n)), n = 0..6);
A372723 Triangle read by rows: Column k has e.g.f. t^k / ((1 - t)^(k + 1) * exp(t)).
1, 0, 1, 1, 2, 2, 2, 9, 12, 6, 9, 44, 84, 72, 24, 44, 265, 640, 780, 480, 120, 265, 1854, 5430, 8520, 7560, 3600, 720, 1854, 14833, 50988, 97650, 112560, 78120, 30240, 5040, 14833, 133496, 526568, 1189104, 1681680, 1525440, 866880, 282240, 40320
Offset: 0
Examples
Triangle starts: [0] 1; [1] 0, 1; [2] 1, 2, 2; [3] 2, 9, 12, 6; [4] 9, 44, 84, 72, 24; [5] 44, 265, 640, 780, 480, 120; [6] 265, 1854, 5430, 8520, 7560, 3600, 720; [7] 1854, 14833, 50988, 97650, 112560, 78120, 30240, 5040; [8] 14833, 133496, 526568, 1189104, 1681680, 1525440, 866880, 282240, 40320;
Crossrefs
Programs
-
Maple
MAX := 14; gf := k -> t^k / ((1 - t)^(k + 1) * exp(t)): ser := k -> series(gf(k), t, MAX): col := k -> local n; seq(n!*coeff(series(ser(k), t, MAX-1), t, n), n = 0..MAX-2): T := (n, k) -> col(k)[n+1]: seq(lprint(seq(T(n, k), k = 0..n)), n = 0..8);
Comments
Examples
Links
Crossrefs
Programs
Maple
Mathematica
Formula