%I #17 Jul 28 2024 12:12:10
%S 1,2,6,18,54,162,454,1267,3613,10344,29572,84436,240868,686884,
%T 1959636,5592181,15957717,45533682,129922090,370708166,1057755082,
%U 3018154342,8611878218,24572725639,70114579881,200061418144,570845362600
%N Number of permutations satisfying i-2<=p(i)<=i+5, i=1..n.
%H R. H. Hardin, <a href="/A072852/b072852.txt">Table of n, a(n) for n=1..400</a>
%H Vladimir Baltic, <a href="http://pefmath.etf.rs/vol4num1/AADM-Vol4-No1-119-135.pdf">On the number of certain types of strongly restricted permutations</a>, Applicable Analysis and Discrete Mathematics Vol. 4, No 1 (April, 2010), 119-135
%H <a href="/index/Rec#order_21">Index entries for linear recurrences with constant coefficients</a>, signature (1, 2, 4, 7, 13, 22, 28, -4, -6, -6, 0, -4, -10, -10, 0, 1, 1, 0, 0, 1, 1).
%F 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);
%t 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 *)
%Y Cf. A002524..A002529, A072827, A072850..A072856, A079955..A080014.
%K nonn
%O 1,2
%A _Vladimir Baltic_, Jul 25 2002