A001565
3rd differences of factorial numbers.
Original entry on oeis.org
2, 11, 64, 426, 3216, 27240, 256320, 2656080, 30078720, 369774720, 4906137600, 69894316800, 1064341555200, 17255074636800, 296754903244800, 5396772116736000, 103484118786048000, 2086818140639232000, 44150769074700288000, 977904962186600448000
Offset: 0
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
-
List([0..20], n-> (n^3+3*n^2+5*n+2)*Factorial(n)); # G. C. Greubel, Apr 29 2019
-
[(n^3+3*n^2+5*n+2)*Factorial(n): n in [0..20]]; // G. C. Greubel, Apr 29 2019
-
Table[(n^3 +3*n^2 +5*n +2) n!, {n, 0, 20}] (* T. D. Noe, Aug 09 2012 *)
Differences[Range[0, 25]!, 3] (* Paolo Xausa, May 28 2025 *)
-
{a(n) = (n^3+3*n^2+5*n+2)*n!}; \\ G. C. Greubel, Apr 29 2019
-
[(n^3+3*n^2+5*n+2)*factorial(n) for n in (0..20)] # G. C. Greubel, Apr 29 2019
A033815
Number of standard permutations of [ a_1..a_n b_1..b_n ] (b_i is not immediately followed by a_i, for all i).
Original entry on oeis.org
1, 1, 14, 426, 24024, 2170680, 287250480, 52370755920, 12585067447680, 3854801333416320, 1465957162768492800, 677696237345719468800, 374281829360322587827200, 243388909697235614324812800, 184070135024053703140543027200, 160192129141963141211280644352000
Offset: 0
- R. P. Stanley, Enumerative Combinatorics I, Chap.2, Exercise 10, p. 89.
- Reinhard Zumkeller, Table of n, a(n) for n = 0..200
- Leo Chao, Paul DesJarlais and John L Leonard, A binomial identity, via derangements, Math. Gaz. 89 (2005), 268-270.
- Ira Gessel, Enumerative applications of symmetric functions, Séminaire Lotharingien de Combinatoire, B17a (1987), 17 pp.
-
a033815 n = a116854 (2 * n + 1) (n + 1)
-- Reinhard Zumkeller, Aug 31 2014
-
A033815 := proc(n) local i; add(binomial(n, i)*(-1)^i*(2*n - i)!, i = 0 .. n) end;
# second Maple program:
A:= proc(n, k) A(n, k):= `if`(k=0, n!, A(n+1, k-1) -A(n, k-1)) end:
a:= n-> A(n$2):
seq(a(n), n=0..23); # Alois P. Heinz, Feb 22 2019
-
a[n_] := (2n)!*Hypergeometric1F1[-n, -2n, -1]; Table[a[n], {n, 0, 14}] (* Jean-François Alcover, Jun 13 2012, after Vladimir Reshetnikov *)
A155521
Smallest fixed point summed over all non-derangement permutations of {1,2,...,n}.
Original entry on oeis.org
0, 1, 1, 7, 31, 191, 1331, 10655, 95887, 958879, 10547659, 126571919, 1645434935, 23036089103, 345541336531, 5528661384511, 93987243536671, 1691770383660095, 32143637289541787, 642872745790835759, 13500327661607550919
Offset: 0
a(3)=7 because the non-derangements of {1,2,3} are 123, 132, 213, 321 with smallest fixed points 1, 1, 3, 2.
-
a[0] := 0: for n to 25 do a[n] := (n+1)*a[n-1]+n*(-1)^(n+1) end do: seq(a[n], n = 0 .. 21);
-
CoefficientList[Series[(1-(1+x^2)*E^(-x))/(1-x)^2, {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Oct 20 2012 *)
A047922
Triangle of numbers a(n,k) = number of terms in n X n determinant with 2 adjacent diagonals of k and k-1 0's (0<=k<=n).
Original entry on oeis.org
1, 1, 0, 2, 1, 0, 6, 4, 1, 1, 24, 18, 8, 5, 3, 120, 96, 54, 34, 23, 16, 720, 600, 384, 258, 182, 131, 96, 5040, 4320, 3000, 2136, 1566, 1168, 883, 675, 40320, 35280, 25920, 19320, 14664, 11274, 8756, 6859, 5413, 362880, 322560, 246960, 190800, 149160, 117696, 93582, 74902, 60301, 48800
Offset: 0
Triangle starts:
1;
1, 0;
2, 1, 0;
6, 4, 1, 1;
...
- Alois P. Heinz, Rows n = 0..140, flattened
- J. D. H. Dickson, Discussion of two double series arising from the number of terms in determinants of certain forms, Proc. London Math. Soc., 10 (1879), 120-122.
- J. D. H. Dickson, Discussion of two double series arising from the number of terms in determinants of certain forms, Proc. London Math. Soc., 10 (1879), 120-122. [Annotated scanned copy]
-
a:= proc(n, k) option remember; `if`(k=0, n!, `if`(n=k,
`if`(n<3, (n-1)*(n-2)/2, (n-1)*(a(n-1$2)+a(n-2$2))
+a(n-3$2)), a(n, k+1) +2*a(n-1, k) +a(n-2, k-1)))
end:
seq(seq(a(n, k), k=0..n), n=0..10); # Alois P. Heinz, Jun 24 2017
-
a[n_, n_] := (-1)^n*HypergeometricPFQ[{1, -n, n+1}, {1/2}, 1/4]; a[n_, k_] := a[n, k] = a[n, k+1] + 2*a[n-1, k] + a[n-2, k-1]; Table[a[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 24 2015 *)
More terms from Larry Reeves (larryr(AT)acm.org), Sep 29 2000
A060475
Triangular array formed from successive differences of factorial numbers, then with factorials removed.
Original entry on oeis.org
1, 1, 0, 1, 1, 1, 1, 2, 3, 2, 1, 3, 7, 11, 9, 1, 4, 13, 32, 53, 44, 1, 5, 21, 71, 181, 309, 265, 1, 6, 31, 134, 465, 1214, 2119, 1854, 1, 7, 43, 227, 1001, 3539, 9403, 16687, 14833, 1, 8, 57, 356, 1909, 8544, 30637, 82508, 148329, 133496, 1, 9, 73, 527, 3333, 18089, 81901, 296967, 808393, 1468457, 1334961
Offset: 0
Triangle begins
1,
1, 0,
1, 1, 1,
1, 2, 3, 2,
1, 3, 7, 11, 9,
1, 4, 13, 32, 53, 44,
...
- G. C. Greubel, Rows n=0..100 of triangle, flattened
- A. Laradji, and A. Umar, Combinatorial results for the symmetric inverse semigroup, Semigroup Forum 75 (2007), 221-236. - _Abdullahi Umar_, Sep 14 2008
- L. Takacs, The Problem of Coincidences, Archive for History of Exact Sciences, Volume 21, No. 3, Sept. 1980. pp 229-244, paragraph 10 (Catalan).
-
[[Factorial(k)*(&+[(-1)^j*Binomial(n-j, k-j)/Factorial(j): j in [0..k]]): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Mar 04 2019
-
A060475 := proc(n,k): k! * add(binomial(n-j,k-j)*(-1)^j/j!, j=0..k) end:
seq(seq(A060475(n,k), k=0..n), n=0..7); # Johannes W. Meijer, Jul 27 2011
T := (n,k) -> KummerU(-k, -n, -1):
seq(seq(simplify(T(n, k)), k = 0..n), n = 0..10); # Peter Luschny, Jul 07 2022
-
t[n_, k_] := k!*Sum[Binomial[n - j, k - j]*(-1)^j/j!, {j, 0, k}]; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Robert G. Wilson v, Aug 08 2011 *)
-
{T(n,k) = k!*sum(j=0,k, (-1)^j*binomial(n-j, k-j)/j!)};
for(n=0,10, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Mar 04 2019
-
[[factorial(k)*sum((-1)^j*binomial(n-j, k-j)/factorial(j) for j in (0..k)) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Mar 04 2019
A129867
Row sums of triangular array T: T(j,k) = k*(j-k)! for k < j, T(j,k) = 1 for k = j; 1 <= k <= j.
Original entry on oeis.org
1, 2, 5, 14, 47, 200, 1073, 6986, 53219, 462332, 4500245, 48454958, 571411271, 7321388384, 101249656697, 1502852293010, 23827244817323, 401839065437636, 7182224591785949, 135607710526966262, 2696935204638786575
Offset: 1
First seven rows of T are
[ 1 ]
[ 1, 1 ]
[ 2, 2, 1 ]
[ 6, 4, 3, 1 ]
[ 24, 12, 6, 4, 1 ]
[ 120, 48, 18, 8, 5, 1 ]
[ 720, 240, 72, 24, 10, 6, 1 ]
A076732
Table T(n,k) giving number of ways of obtaining exactly one correct answer on an (n,k)-matching problem (1 <= k <= n).
Original entry on oeis.org
1, 1, 0, 1, 2, 3, 1, 4, 9, 8, 1, 6, 21, 44, 45, 1, 8, 39, 128, 265, 264, 1, 10, 63, 284, 905, 1854, 1855, 1, 12, 93, 536, 2325, 7284, 14833, 14832, 1, 14, 129, 908, 5005, 21234, 65821, 133496, 133497, 1, 16, 171, 1424, 9545, 51264, 214459, 660064, 1334961, 1334960
Offset: 1
Triangle begins
1;
1,0;
1,2,3;
1,4,9,8;
...
-
A076732:=proc(n,k): (k/(n-k)!)*A047920(n,k) end: A047920:=proc(n,k): add(((-1)^j)*binomial(k-1,j)*(n-1-j)!, j=0..k-1) end: seq(seq(A076732(n,k), k=1..n), n=1..10); # Johannes W. Meijer, Jul 27 2011
-
A000240[n_] := Subfactorial[n] - (-1)^n;
T[n_, k_] := T[n, k] = Switch[k, 1, 1, n, A000240[n], _, k*T[n-1, k-1] + T[n-1, k]];
Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 14 2023 *)
A116853
Difference triangle of factorial numbers read by upward diagonals.
Original entry on oeis.org
1, 1, 2, 3, 4, 6, 11, 14, 18, 24, 53, 64, 78, 96, 120, 309, 362, 426, 504, 600, 720, 2119, 2428, 2790, 3216, 3720, 4320, 5040, 16687, 18806, 21234, 24024, 27240, 30960, 35280, 40320
Offset: 1
Starting with 1, 2, 6, 24, 120 ... we take the first difference row (A001563), second, third, etc. Reorient into a flush left format, getting:
[1] 1;
[2] 1, 2;
[3] 3, 4, 6;
[4] 11, 14, 18, 24;
[5] 53, 64, 78, 96, 120;
[6] 309, 362, 426, 504, 600, 720;
...
-
a116853 n k = a116853_tabl !! (n-1) !! (k-1)
a116853_row n = a116853_tabl !! (n-1)
a116853_tabl = map reverse $ f (tail a000142_list) [] where
f (u:us) vs = ws : f us ws where ws = scanl (-) u vs
-- Reinhard Zumkeller, Aug 31 2014
-
rows = 8;
rr = Range[rows]!;
dd = Table[Differences[rr, n], {n, 0, rows-1}];
T = Array[t, {rows, rows}];
Do[Thread[Evaluate[Diagonal[T, -k+1]] = dd[[k, ;;rows-k+1]]], {k, rows}];
Table[t[n, k], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Dec 21 2019 *)
A136301
Frequency of occurrence for each possible "probability of derangement" for a Secret Santa drawing in which each person draws a name in sequence and the only person who does not draw someone else's name is the one who draws the final name.
Original entry on oeis.org
1, 1, 1, 1, 5, 2, 1, 1, 13, 6, 13, 2, 6, 2, 1, 1, 29, 14, 73, 6, 42, 18, 29, 2, 18, 8, 14, 2, 6, 2, 1, 1, 61, 30, 301, 14, 186, 86, 301, 6, 102, 48, 186, 18, 102, 42, 61, 2, 42, 20, 86, 8, 48, 20, 30, 2, 18, 8, 14, 2, 6, 2, 1, 1, 125, 62, 1081, 30, 690, 330, 2069, 14, 414, 200, 1394
Offset: 3
Represented as a series of columns, where column j has 2^(j-1) rows, the sequence begins:
row |j = 1 2 3 4 5 ...
----+-------------------------
1 | 1 1 1 1 1 ...
2 | 1 5 13 29 ...
3 | 2 6 14 30 ...
4 | 1 13 73 301 ...
5 | 2 6 14 ...
6 | 6 42 186 ...
7 | 2 18 86 ...
8 | 1 29 301 ...
9 | 2 6 ...
10 | 18 102 ...
11 | 8 48 ...
12 | 14 186 ...
13 | 2 18 ...
14 | 6 102 ...
15 | 2 42 ...
16 | 1 61 ...
17 | 2 ...
... | ... ...
.
If there are 5 people, numbered 1-5 according to the order in which they draw a name, and person #5 draws name #5, the first four people must draw 1-4 as a proper derangement, and there are 9 ways of doing so: 21435 / 23415 / 24135 / 31425 / 34125 / 34215 / 41235 / 43125 / 43215.
But the probability of each derangement depends on how many choices exist at each successive draw. The first person can draw from 4 possibilities (2,3,4,5). The second person nominally has 3 to choose from, unless the first person drew number 2, in which case person 2 may draw 4 possibilities (1,3,4,5), and so on. The probabilities of 21435 and 24135 are both then
1/4 * 1/4 * 1/2 * 1/2 = 1/64.
More generally, if there are n people, at the i-th turn (i = 1..n), person i has either (n-i) or (n-i+1) choices, depending on whether the name of the person who is drawing has been chosen yet. A way to represent the two cases above is 01010, where a 0 indicates that the person's number is not yet drawn, and a 1 indicates it is.
For the n-th person to be forced to choose his or her own name, the last digit of this pattern must be 0, by definition. Similarly, the 1st digit must be a 0, and the second to last digit must be a 1. So all the problem patterns start with 0 and end with 10. For 5 people, that leaves 4 target patterns which cover all 9 derangements. By enumeration, that distribution can be shown to be (for the 3rd column = 5 person case):
0-00-10 1 occurrences
0-01-10 5 occurrences
0-10-10 2 occurrences
0-11-11 1 occurrences
1;
1, 1;
1, 5, 2, 1;
1, 13, 6, 13, 2, 6, 2, 1;
1, 29, 14, 73, 6, 42, 18, 29, 2, 18, 8, 14, 2, 6, 2, 1;
The application of this table towards final determination of the probabilities of derangements leads to sequence
A136300, which is the sequence of numerators. The denominators are in
A001044.
A048144 represents the peak value of all odd-numbers columns.
A000255 equals the sum of the bottom half of each column.
A000166 equals the sum of each column.
A047920 represents the frequency of replacements by person drawing at position n.
A008277, Triangle of Stirling numbers of 2nd kind, can be derived from
A136301 through a series of transformations (see "Probability of Derangements.pdf").
-
maxP = 15;
rows = Range[1, 2^(nP = maxP - 3)];
pasc = Table[
Binomial[p + 1, i] - If[i >= p, 1, 0], {p, nP}, {i, 0, p}];
sFreq = Table[0, {maxP - 1}, {2^nP}]; sFreq[[2 ;; maxP - 1, 1]] = 1;
For[p = 1, p <= nP, p++,
For[s = 1, s <= p, s++, rS = Range[2^(s - 1) + 1, 2^s];
sFreq[[p + 2, rS]] = pasc[[p + 1 - s, 1 ;; p + 2 - s]] .
sFreq[[s ;; p + 1, 1 ;; 2^(s - 1)]]]];
TableForm[ Transpose[ sFreq ] ]
(* Code snippet to illustrate the conjectured connection with A371761: *)
R[n_] := Table[Transpose[sFreq][[2^n]][[r]], {r, n + 1, maxP - 1}]
For[n = 0, n <= 6, n++, Print[n + 1, ": ", R[n]]] (* Peter Luschny, Apr 10 2024 *)
A306535
Number of permutations p of [2n] having no index i with |p(i)-i| = n.
Original entry on oeis.org
1, 1, 9, 265, 14833, 1334961, 176214841, 32071101049, 7697064251745, 2355301661033953, 895014631192902121, 413496759611120779881, 228250211305338670494289, 148362637348470135821287825, 112162153835443422680893595673, 97581073836835777732377428235481
Offset: 0
-
b:= proc(n, k) b(n, k):= `if`(k=0, n!, b(n+1, k-1) -b(n, k-1)) end:
a:= n-> b(0, 2*n):
seq(a(n), n=0..23);
seq(simplify(KummerU(-2*n, -2*n, -1)), n=0..15); # Peter Luschny, May 10 2022
-
b[n_, k_] := b[n, k] = If[k == 0, n!, b[n + 1, k - 1] - b[n, k - 1]];
a[n_] := b[0, 2n];
a /@ Range[0, 23] (* Jean-François Alcover, Apr 02 2021, after Alois P. Heinz *)
Comments