A259776
Number A(n,k) of permutations p of [n] with no fixed points and displacement of elements restricted by k: 1 <= |p(i)-i| <= k, square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 4, 0, 0, 1, 0, 1, 2, 9, 6, 1, 0, 1, 0, 1, 2, 9, 24, 13, 0, 0, 1, 0, 1, 2, 9, 44, 57, 24, 1, 0, 1, 0, 1, 2, 9, 44, 168, 140, 45, 0, 0, 1, 0, 1, 2, 9, 44, 265, 536, 376, 84, 1, 0
Offset: 0
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, ...
0, 0, 0, 0, 0, 0, 0, 0, ...
0, 1, 1, 1, 1, 1, 1, 1, ...
0, 0, 2, 2, 2, 2, 2, 2, ...
0, 1, 4, 9, 9, 9, 9, 9, ...
0, 0, 6, 24, 44, 44, 44, 44, ...
0, 1, 13, 57, 168, 265, 265, 265, ...
0, 0, 24, 140, 536, 1280, 1854, 1854, ...
Columns k=0-10 give:
A000007,
A059841,
A033305,
A079997,
A259777,
A259778,
A259779,
A259780,
A259781,
A259782,
A259783.
-
b:= proc(n, s, k) option remember; `if`(n=0, 1, `if`(n+k in s,
b(n-1, (s minus {n+k}) union `if`(n-k>1, {n-k-1}, {}), k),
add(`if`(j=n, 0, b(n-1, (s minus {j}) union
`if`(n-k>1, {n-k-1}, {}), k)), j=s)))
end:
A:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), b(n, {$max(1, n-k)..n}, k)):
seq(seq(A(n, d-n), n=0..d), d=0..12);
-
b[n_, s_, k_] := b[n, s, k] = If[n==0, 1, If[MemberQ[s, n+k], b[n-1, Join[s ~Complement~ {n+k}] ~Union~ If[n-k>1, {n-k-1}, {}], k], Sum[If[j==n, 0, b[n -1, Join[s ~Complement~ {j}] ~Union~ If[n-k>1, {n-k-1}, {}], k]], {j, s}]] ];
A[n_, k_] := If[k == 0, If[n == 0, 1, 0], b[n, Range[Max[1, n-k], n], k]];
Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Mar 29 2017, translated from Maple *)
A259834
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals n-1.
Original entry on oeis.org
0, 0, 1, 2, 5, 20, 97, 574, 3973, 31520, 281825, 2803418, 30704101, 367114252, 4757800705, 66432995030, 994204132517, 15875195019224, 269397248811073, 4841453414347570, 91856764780324165, 1834779993945449348, 38485629141294791201, 845788826477292504302
Offset: 0
a(2) = 1: 21.
a(3) = 2: 231, 312.
a(4) = 5: 2341, 3421, 4123, 4312, 4321.
-
a:= proc(n) option remember; `if`(n<3, [0, 0, 1][n+1],
((2*n^2-11*n+13)*a(n-1) +(2*n-5)*(n-3)*a(n-2))/(2*n-7))
end:
seq(a(n), n=0..30);
-
Join[{0, 0}, Table[DifferenceRoot[Function[{y, m}, {y[1 + m] == (n - m)*y[m] + (n - m) y[m - 1], y[0] == 0, y[1] == 1, y[2] == 1}]][n], {n, 2, 30}]] (* Benedict W. J. Irwin, Nov 03 2016 *)
Table[If[n<2, 0, Subfactorial[n-2]+2*Subfactorial[n-1]], {n,0,23}] (* Peter Luschny, Oct 04 2017 *)
-
def A259834_list(len):
L, u, x, y = [0], 1, 0, 0
for n in range(len):
y, x, u = x, x*n + u, -u
L.append(y + 2*x)
L[1] = 0
return L
print(A259834_list(23)) # Peter Luschny, Oct 04 2017
A321048
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals two.
Original entry on oeis.org
0, 2, 3, 6, 12, 24, 44, 84, 159, 300, 564, 1064, 2004, 3774, 7107, 13386, 25208, 47472, 89400, 168360, 317055, 597080, 1124424, 2117520, 3987720, 7509690, 14142275, 26632782, 50154948, 94451976, 177872292, 334969724, 630816159, 1187955204, 2237161404
Offset: 2
A321049
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals three.
Original entry on oeis.org
0, 5, 18, 44, 116, 331, 932, 2532, 6720, 17804, 47280, 125460, 331736, 874973, 2305750, 6075184, 16001968, 42130767, 110885496, 291792264, 767776064, 2020061968, 5314529928, 13981117152, 36779372688, 96751538581, 254510051546, 669494097852, 1761102380100
Offset: 3
- Alois P. Heinz, Table of n, a(n) for n = 3..1000
- Index entries for linear recurrences with constant coefficients, signature (3,0,-3,6,-7,-11,-14,0,16,18,6,-7,1,-2,1,-2,-1,1).
A321050
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals four.
Original entry on oeis.org
0, 20, 111, 396, 1285, 4312, 15437, 55572, 196288, 678270, 2311191, 7856610, 26732463, 90996552, 309390463, 1049670138, 3554983881, 12027825752, 40676758809, 137534141216, 464908099716, 1571078027012, 5307751810223, 17928124690902, 60548310641344
Offset: 4
A321051
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals five.
Original entry on oeis.org
0, 97, 744, 3628, 15038, 59963, 245386, 1054116, 4585666, 19816317, 84377528, 354143757, 1472404694, 6105113905, 25314316974, 105009933736, 435538239600, 1804712603943, 7467462109856, 30859243303779, 127410491972804, 525761755401512, 2168906840165128
Offset: 5
A321052
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals six.
Original entry on oeis.org
0, 574, 5571, 34948, 181193, 870934, 4113244, 19845700, 99472963, 505871096, 2572439079, 12975021278, 64715221044, 319501249574, 1566516774344, 7660714576044, 37445731303872, 183081927465284, 895275467752721, 4376669424005308, 21379883128454905
Offset: 6
A321053
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals seven.
Original entry on oeis.org
0, 3973, 46662, 359724, 2270840, 12994207, 71401928, 389384029, 2162806868, 12393816965, 72063175820, 420431229772, 2443816138204, 14098735154983, 80635213447724, 457661900843292, 2583741730021382, 14552232847553984, 81904772313605164, 461011600699499344
Offset: 7
A321054
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals eight.
Original entry on oeis.org
0, 31520, 434127, 3979676, 29836261, 200251036, 1269799244, 7866814026, 48627012403, 305484315674, 1970229533360, 12885942393622, 84719993481585, 556551975117208, 3639388789709545, 23644099935731588, 152553455368658432, 978410935801325180, 6248373677853677799
Offset: 8
A321055
Number of permutations of [n] with no fixed points where the maximal displacement of an element equals nine.
Original entry on oeis.org
0, 281825, 4451724, 47355884, 412882090, 3202361483, 23212224128, 162423570785, 1121100331330, 7743988554848, 54274875428464, 389110611485999, 2826724445254744, 20662487594362983, 151199827593760314, 1103728723985787116, 8020129818824497034
Offset: 9
Showing 1-10 of 12 results.
Comments