%I #22 Apr 16 2024 03:28:12
%S 1,0,1,0,2,1,3,2,5,5,9,10,16,20,30,39,56,75,106,144,201,275,382,525,
%T 727,1001,1384,1908,2636,3636,5021,6928,9565,13200,18222,25149,34715,
%U 47914,66137,91285,126001,173914,240052,331336,457338,631251,871304,1202639
%N Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i not in I, i=1..n, with k=1, r=4, I={0,2}.
%C Number of compositions (ordered partitions) of n into elements of the set {2,4,5}.
%D 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.
%H Harvey P. Dale, <a href="/A079974/b079974.txt">Table of n, a(n) for n = 0..1000</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 (2010), 119-135.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,1).
%F Recurrence: a(n) = a(n-2)+a(n-4)+a(n-5).
%F G.f.: -1/(x^5+x^4+x^2-1)
%t a=b=c=d=0;Table[e=a-d+1;a=b;b=c;c=d;d=e,{n,25}] (* _Vladimir Joseph Stephan Orlovsky_, Feb 26 2011*)
%t LinearRecurrence[{0,1,0,1,1},{1,0,1,0,2},50] (* _Harvey P. Dale_, Apr 12 2014 *)
%Y Cf. A002524-A002529, A072827, A072850-A072856, A079955-A080014.
%K nonn,easy
%O 0,5
%A _Vladimir Baltic_, Feb 17 2003