A072852 Number of permutations satisfying i-2<=p(i)<=i+5, i=1..n.
1, 2, 6, 18, 54, 162, 454, 1267, 3613, 10344, 29572, 84436, 240868, 686884, 1959636, 5592181, 15957717, 45533682, 129922090, 370708166, 1057755082, 3018154342, 8611878218, 24572725639, 70114579881, 200061418144, 570845362600
Offset: 1
Keywords
Links
- R. H. Hardin, Table of n, a(n) for n=1..400
- Vladimir Baltic, On the number of certain types of strongly restricted permutations, Applicable Analysis and Discrete Mathematics Vol. 4, No 1 (April, 2010), 119-135
- Index entries for linear recurrences with constant coefficients, signature (1, 2, 4, 7, 13, 22, 28, -4, -6, -6, 0, -4, -10, -10, 0, 1, 1, 0, 0, 1, 1).
Programs
-
Mathematica
CoefficientList[Series[-(x^14+x^12+x^10+x^8-6x^7-x^6-4x^5-3x^4-2x^3-x^2+1)/(x^21+x^20+ x^17+x^16- 10x^14-10x^13-4x^12-6x^10- 6x^9-4x^8+28x^7+22x^6+ 13x^5+7x^4+4x^3+ 2x^2+x-1),{x,0,30}],x] (* or *) LinearRecurrence[{1,2,4,7,13,22,28,-4,-6,-6,0,-4,-10,-10,0,1,1,0,0,1,1},{1,1,2,6,18,54,162,454,1267,3613,10344,29572,84436,240868,686884,1959636,5592181,15957717,45533682,129922090,370708166},30] (* Harvey P. Dale, Jul 28 2024 *)
Formula
Recurrence: a(n) = a(n - 1) + 2*a(n - 2) + 4*a(n - 3) + 7*a(n - 4) + 13*a(n - 5) + 22*a(n - 6) + 28*a(n - 7) - 4*a(n - 8) - 6*a(n - 9) - 6*a(n - 10) - 4*a(n - 12) - 10*a(n - 13) - 10*a(n - 14) + a(n - 16) + a(n - 17) + a(n - 20) + a(n - 21). G.f.: - (x^14 + x^12 + x^10 + x^8 - 6*x^7 - x^6 - 4*x^5 - 3*x^4 - 2*x^3 - x^2 + 1)/(x^21 + x^20 + x^17 + x^16 - 10*x^14 - 10*x^13 - 4*x^12 - 6*x^10 - 6*x^9 - 4*x^8 + 28*x^7 + 22*x^6 + 13*x^5 + 7*x^4 + 4*x^3 + 2*x^2 + x - 1);