A079885
Number of index tests required to create all permutations of n distinct elements using the "streamlined" version of Algorithm L (lexicographic permutation generation) from Knuth's The Art of Computer Programming, Vol. 4, chapter 7.2.1.2.
Original entry on oeis.org
0, 4, 29, 185, 1314, 10534, 94839, 948427, 10432748, 125193032, 1627509489, 22785132925
Offset: 3
- For references and corresponding links see under A079884
A166554
a(0)=1, a(n) = n*(a(n-1) - 1) for n>0.
Original entry on oeis.org
1, 0, -2, -9, -40, -205, -1236, -8659, -69280, -623529, -6235300, -68588311, -823059744, -10699776685, -149796873604, -2246953104075, -35951249665216, -611171244308689, -11001082397556420, -209020565553571999
Offset: 0
-
[n le 1 select 1 else (n-1)*(Self(n-1) - 1): n in [1..41]]; // G. C. Greubel, Nov 30 2024
-
RecurrenceTable[{a[0]==1,a[n]==n(a[n-1]-1)},a[n],{n,20}] (* Harvey P. Dale, Jul 25 2011 *)
-
def A166554(n): return 1 +factorial(n) -int(exp(1)*factorial(n)) +int(n==0)
print([A166554(n) for n in range(41)]) # G. C. Greubel, Nov 30 2024
A268218
a(n) = (n!/3!)*Sum(1/k!,k=1..n-3).
Original entry on oeis.org
0, 0, 0, 0, 4, 30, 200, 1435, 11536, 103908, 1039200, 11431365, 137176600, 1783296086, 24966145568, 374492183975, 5991874944160, 101861874051400, 1833513732926016, 34836760925595273, 696735218511906600, 14631439588750039930, 321891670952500880000, 7403508431907520241771
Offset: 0
-
g:=(r,n)->(n!/r!)*add(1/k!,k=1..n-r);
g2:=r->[seq(g(r,n),n=0..30)];
g2(3);
-
a(n) = (n!/3!)*sum(k=1, n-3, 1/k!); \\ Michel Marcus, Jan 30 2016
A285268
Triangle read by rows: T(m,n) = Sum_{i=1..n} P(m,i) where P(m,n) = m!/(m-n)! is the number of permutations of m items taken n at a time, for 1 <= n <= m.
Original entry on oeis.org
1, 2, 4, 3, 9, 15, 4, 16, 40, 64, 5, 25, 85, 205, 325, 6, 36, 156, 516, 1236, 1956, 7, 49, 259, 1099, 3619, 8659, 13699, 8, 64, 400, 2080, 8800, 28960, 69280, 109600, 9, 81, 585, 3609, 18729, 79209, 260649, 623529, 986409, 10, 100, 820, 5860, 36100, 187300, 792100, 2606500, 6235300, 9864100
Offset: 1
Triangle begins:
1;
2, 4;
3, 9, 15;
4, 16, 40, 64;
5, 25, 85, 205, 325;
6, 36, 156, 516, 1236, 1956;
7, 49, 259, 1099, 3619, 8659, 13699;
8, 64, 400, 2080, 8800, 28960, 69280, 109600;
9, 81, 585, 3609, 18729, 79209, 260649, 623529, 986409;
...
Diagonals (1..4):
A007526 (less the initial 0),
A038156 (less the initial 0, 0),
A224869 (less the initial -1, 0),
A079750 (less the initial 0).
-
SumPermuteTriangle := proc(M)
local m;
for m from 1 to M do print(seq(add(m!/(m-k)!, k=1..n), n=1..m)) od;
end:
SumPermuteTriangle(10);
# second Maple program:
T:= proc(n, k) option remember;
`if`(k<1, 0, T(n-1, k-1)*n+n)
end:
seq(seq(T(n, k), k=1..n), n=1..10); # Alois P. Heinz, Jun 26 2022
-
Table[Sum[m!/(m - i)!, {i, n}], {m, 9}, {n, m}] // Flatten (* Michael De Vlieger, Apr 22 2017 *)
(* Sum-free code *)
b[j_] = If[j==0, 0, Floor[j! E - 1]]; T[m_,n_] = b[m] - m! b[m-n]/(m-n)!; Table[T[m, n],{m, 24},{n, m}]//Flatten
(* Manfred Boergens, Jun 22 2022 *)
-
A285268(m,n,s=m-n+1)={for(k=m-n+2,m,s=(s+1)*k);s} \\ Much faster than sum(k=1,n,m!\(m-k)!), e.g., factor 6 for m=1..99, factor 57 for m=1..199.
apply( A285268_row(m)=vector(m,n,A285268(m,n)), [1..9]) \\ M. F. Hasler, Oct 10 2019
-
T(n, k) = {exp(1)*(incgam(n+1, 1) - incgam(n-k, 1)*(n-k)*n!/(n-k)!) - 1;}
apply(Trow(n) = vector(n, k, round(T(n, k))), [1..10]) \\ Adjust the realprecision if needed. Peter Luschny, Oct 10 2019
A082459
Multiply by 1, add 1, multiply by 2, add 2, etc.
Original entry on oeis.org
-1, -1, 0, 0, 2, 6, 9, 36, 40, 200, 205, 1230, 1236, 8652, 8659, 69272, 69280, 623520, 623529, 6235290, 6235300, 68588300, 68588311, 823059732, 823059744, 10699776672, 10699776685, 149796873590, 149796873604, 2246953104060, 2246953104075, 35951249665200, 35951249665216
Offset: 0
-
seq(op(simplify([exp(1)*GAMMA(k+1,1)-k!-1, exp(1)*GAMMA(k+2,1)-(k+1)!-k-2])),k=0..20); # Robert Israel, Jan 11 2018
-
FoldList[If[OddQ@ #2, #1 ((#2 + 1)/2), #1 + #2/2] &, -1, Range@ 31] (* Michael De Vlieger, Jan 11 2018 *)
A224869
a(n) = n*( a(n-1)+1 ), initialized by a(1) = -1.
Original entry on oeis.org
-1, 0, 3, 16, 85, 516, 3619, 28960, 260649, 2606500, 28671511, 344058144, 4472755885, 62618582404, 939278736075, 15028459777216, 255483816212689, 4598708691828420, 87375465144739999, 1747509302894800000, 36697695360790800021, 807349297937397600484
Offset: 1
a(4) = 4*(a(3)+1) = 4*4 = 16.
A268220
a(n) = (n!/5!)*Sum(1/k!,k=1..n-5).
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 6, 63, 560, 5166, 51912, 571494, 6858720, 89164647, 1248307060, 18724608903, 299593746816, 5093093702060, 91675686645648, 1741838046278940, 34836760925594304, 731571979437500733, 16094583547625042460, 370175421595376010229, 8884210118289024288000
Offset: 0
-
g:=(r,n)->(n!/r!)*add(1/k!,k=1..n-r);
g2:=r->[seq(g(r,n),n=0..30)];
g2(5);
-
a(n) = (n!/5!)*sum(k=1, n-5, 1/k!); \\ Michel Marcus, Jan 30 2016
A296964
Expansion of e.g.f. (exp(x)-x)*x/(1-x).
Original entry on oeis.org
0, 1, 2, 9, 40, 205, 1236, 8659, 69280, 623529, 6235300, 68588311, 823059744, 10699776685, 149796873604, 2246953104075, 35951249665216, 611171244308689, 11001082397556420, 209020565553571999, 4180411311071440000, 87788637532500240021, 1931350025715005280484, 44421050591445121451155
Offset: 0
-
Join[{0,1},Drop[With[{nn=30},CoefficientList[Series[(Exp[x]-x)*x/(1-x),{x,0,nn}],x] Range[0,nn]!],2]] (* Harvey P. Dale, Apr 02 2018 *)
-
x = QQ[['x']].gen()
f = (exp(x) - x) * x / (1 - x)
f.egf_to_ogf() # F. Chapoton, Jul 21 2025
A117643
a(n) = n*(a(n-1)-1) starting with a(0)=3.
Original entry on oeis.org
3, 2, 2, 3, 8, 35, 204, 1421, 11360, 102231, 1022300, 11245289, 134943456, 1754264915, 24559708796, 368395631925, 5894330110784, 100203611883311, 1803665013899580, 34269635264092001, 685392705281840000
Offset: 0
a(5) = 5*(a(4)-1) = 5*(8-1) = 35.
Comments