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
A180564
Number of permutations of [n] having no isolated entries. An entry j of a permutation p is isolated if it is not preceded by j-1 and not followed by j+1. For example, the permutation 23178564 has 2 isolated entries: 1 and 4.
Original entry on oeis.org
1, 0, 1, 1, 2, 3, 7, 14, 35, 81, 216, 557, 1583, 4444, 13389, 40313, 128110, 409519, 1366479, 4603338, 16064047, 56708713, 206238116, 759535545, 2870002519, 10986716984, 43019064953, 170663829777, 690840124506, 2832976091771, 11831091960887, 50040503185030
Offset: 0
a(5)=3 because we have 12345, 34512, and 45123.
-
d[ -1] := 0: d[0] := 1: for n to 50 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n) options operator, arrow: sum(binomial(n-j-1, j-1)*(d[j]+d[j-1]), j = 1 .. floor((1/2)*n)) end proc:a(0):=1: seq(a(n), n = 0 .. 32);
# second Maple program:
a:= proc(n) option remember; `if`(n<4, [1, 0, 1, 1][n+1],
(3*a(n-1)+(n-3)*a(n-2)-(n-3)*a(n-3)+(n-4)*a(n-4))/2)
end:
seq(a(n), n=0..31); # Alois P. Heinz, Feb 17 2024
-
a[n_] := If[n == 0, 1, With[{d = Subfactorial}, Sum[Binomial[n-j-1, j-1]* (d[j] + d[j-1]), {j, 1, Floor[n/2]}]]];
Table[a[n], {n, 0, 31}] (* Jean-François Alcover, Sep 17 2024 *)
A184183
Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k blocks of length 2 (0 <= k <= floor(n/2)). A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 5412367 has 4 blocks: 5, 4, 123, and 67; one of them is of length 2.
Original entry on oeis.org
1, 1, 1, 1, 4, 2, 14, 9, 1, 65, 46, 9, 366, 285, 66, 3, 2451, 2006, 539, 44, 18949, 16054, 4776, 530, 11, 166033, 144128, 46230, 6224, 265, 1624948, 1436322, 487573, 75269, 4635, 53, 17561350, 15740718, 5584332, 954116, 74430, 1854, 207650171, 188194591, 69157935, 12776470, 1177625, 44499, 309
Offset: 0
T(4,1) = 9 because we have 1243, 2314, 3421, 3124, 4231, 1342, 4312, 1423, and 2134.
T(6,3) = 3 because we have 563412, 341256, and 125634.
Triangle starts:
1;
1;
1, 1;
4, 2;
14, 9, 1;
65, 46, 9;
366, 285, 66, 3;
...
-
d[-1] := 0: d[0] := 1: for n to 40 do d[n] := n*d[n-1]+(-1)^n end do: b := proc (n, i, j) if i+2*j < n then add(binomial(n+i-2*q-1, q-i-j-1)*factorial(q)*(d[q]+d[q-1])/(factorial(i)*factorial(j)*factorial(q-i-j)), q = i+j+1 .. (1/3)*n+(2/3)*i+(1/3)*j) elif i+2*j = n then factorial(i+j)*(d[i+j]+d[i+j-1])/(factorial(i)*factorial(j)) else 0 end if end proc: T := proc (n, k) options operator, arrow; add(b(n, i, k), i = 0 .. n) end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form
-
d = Subfactorial;
b[n_, i_, j_] := Which[i+2j < n, Sum[Binomial[n+i-2q-1, q-i-j-1]*q!*(d[q]+ d[q-1])/(i!*j!*(q-i-j)!), {q, i+j+1, n/3 + 2i/3 + j/3}], i+2j == n, (i+j)!*((d[i+j] + d[i+j-1])/(i!*j!)), True, 0];
T[n_, k_] := Sum[b[n, i, k], {i, 0, n}]; T[0, 0] = 1;
Table[T[n, k], {n, 0, 12}, {k, 0, Quotient[n, 2]}] // Flatten (* Jean-François Alcover, Feb 16 2021, after Maple *)
Showing 1-3 of 3 results.
Comments