This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A048162 #25 Oct 01 2023 12:20:39 %S A048162 1,1,2,6,9,13,20,31,49,78,125,201,324,523,845,1366,2209,3573,5780, %T A048162 9351,15129,24478,39605,64081,103684,167763,271445,439206,710649, %U A048162 1149853,1860500,3010351,4870849,7881198,12752045,20633241,33385284 %N A048162 Expansion of (1 - x + 3*x^3 - 2*x^4 - 3*x^5)/(1 - 2*x + x^3). %C A048162 Number of permutations of 1..n such that each position is fixed or moves to an adjacent position (with n considered adjacent to 1). For example, a(4) = 9 because there is the identity; 2 cyclic permutations; 4 swaps of one pair of adjacent entries; and 2 swaps of two pairs of adjacent entries. - _Joshua Zucker_, Nov 13 2003 %D A048162 Lehmer, D. H.; Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970. %H A048162 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2, 0, -1). %F A048162 For n>4, a(n) = a(n-1) + a(n-2) - 2. - _Joshua Zucker_, Nov 13 2003 %F A048162 a(n) = Fibonacci(n+1) + Fibonacci(n-1) + 2, for n>2. - Jessa Lee (jessal(AT)comcast.net), Nov 25 2003 %F A048162 For n > 2, a(n)=A001610(n-1) - 3. - _Toby Gottfried_, Apr 13 2013 %t A048162 CoefficientList[Series[(1-x+3x^3-2x^4-3x^5)/(1-2x+x^3),{x,0,40}],x] (* or *) Join[{1,1,2},#[[3]]+#[[1]]+2&/@Partition[Fibonacci[Range[2,50]],3,1]] (* _Harvey P. Dale_, Apr 06 2017 *) %Y A048162 3rd column of A008305. %Y A048162 Cf. A001610. %K A048162 nonn %O A048162 0,3 %A A048162 _N. J. A. Sloane_ %E A048162 Second formula corrected by _David Radcliffe_, Jan 16 2011