|
|
A002524
|
|
Number of permutations of length n within distance 2 of a fixed permutation.
(Formerly M1600 N0626)
|
|
88
|
|
|
1, 1, 2, 6, 14, 31, 73, 172, 400, 932, 2177, 5081, 11854, 27662, 64554, 150639, 351521, 820296, 1914208, 4466904, 10423761, 24324417, 56762346, 132458006, 309097942, 721296815, 1683185225, 3927803988, 9165743600, 21388759708, 49911830577, 116471963129
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Let V(d,n) be the number of permutations of length n within distance d of a fixed permutation. For d=1,2,3,4,...,10 these are A000045, A002524, A002526, A072856, A154654, A154655, A154656, A154657, A154658, A154659. The generating function is a rational function f_d(z)/g_d(z) (see the Kløve report referenced here). For d<=6, deg g_d = 2^{d-1} + binomial(2*d,d)/2 and deg f_d(z) = deg g_d(z)-2d. As a table:
d deg g_d deg f_d
1 2 0
2 5 1
3 14 8
4 43 35
5 142 132
6 494 482
(End)
For positive n, a(n) equals the permanent of the n X n matrix with 1's along the five central diagonals, and 0's everywhere else. - John M. Campbell, Jul 09 2011
|
|
REFERENCES
|
D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.
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).
R. P. Stanley, Enumerative Combinatorics I, Example 4.7.16, p. 253.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (1-x)/(1-2*x-2*x^3+x^5). - Simon Plouffe in his 1992 dissertation.
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI) a(n)=if(n, ([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; -1, 0, 2, 0, 2]^n*[1; 1; 2; 6; 14])[1, 1], 1) \\ Charles R Greathouse IV, Jul 28 2015
(Magma) I:=[1, 1, 2, 6, 14]; [n le 5 select I[n] else 2*Self(n-1) +2*Self(n-3) -Self(n-5): n in [1..41]]; // G. C. Greubel, Jan 21 2022
(Sage) [( (1-x)/(1-2*x-2*x^3+x^5) ).series(x, n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 21 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|